org.eclipse.jface.databinding_1.5.0.I20100907-0800

16:45:26.709 INFO  jd.cli.Main - Decompiling org.eclipse.jface.databinding_1.5.0.I20100907-0800.jar
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;

class DialogPageSupport$1
  implements IChangeListener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$1(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleChange(ChangeEvent event)
  {
    this$0.handleUIChanged();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import java.util.Iterator;
import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;

class DialogPageSupport$2
  implements IListChangeListener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$2(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleListChange(ListChangeEvent event)
  {
    ListDiff diff = diff;
    ListDiffEntry[] differences = diff.getDifferences();
    for (int i = 0; i < differences.length; i++)
    {
      ListDiffEntry listDiffEntry = differences[i];
      ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)listDiffEntry
        .getElement();
      IObservableList targets = validationStatusProvider.getTargets();
      if (listDiffEntry.isAddition())
      {
        targets.addListChangeListener(DialogPageSupport.access$0(this$0));
        for (Iterator it = targets.iterator(); it.hasNext();) {
          ((IObservable)it.next()).addChangeListener(DialogPageSupport.access$1(this$0));
        }
      }
      else
      {
        targets.removeListChangeListener(DialogPageSupport.access$0(this$0));
        for (Iterator it = targets.iterator(); it.hasNext();) {
          ((IObservable)it.next()).removeChangeListener(DialogPageSupport.access$1(this$0));
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.2
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;

class DialogPageSupport$3
  implements IListChangeListener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$3(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleListChange(ListChangeEvent event)
  {
    ListDiff diff = diff;
    ListDiffEntry[] differences = diff.getDifferences();
    for (int i = 0; i < differences.length; i++)
    {
      ListDiffEntry listDiffEntry = differences[i];
      IObservable target = (IObservable)listDiffEntry.getElement();
      if (listDiffEntry.isAddition()) {
        target.addChangeListener(DialogPageSupport.access$1(this$0));
      } else {
        target.removeChangeListener(DialogPageSupport.access$1(this$0));
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.3
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;

class DialogPageSupport$4
  implements IValueChangeListener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$4(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleValueChange(ValueChangeEvent event)
  {
    DialogPageSupport.access$2(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.4
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class DialogPageSupport$5
  implements Listener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$5(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleEvent(Event event)
  {
    this$0.dispose();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.5
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.IStaleListener;
import org.eclipse.core.databinding.observable.StaleEvent;

class DialogPageSupport$6
  implements IStaleListener
{
  final DialogPageSupport this$0;
  
  DialogPageSupport$6(DialogPageSupport paramDialogPageSupport)
  {
    this$0 = paramDialogPageSupport;
  }
  
  public void handleStale(StaleEvent staleEvent)
  {
    this$0.currentStatusStale = true;
    this$0.handleStatusChanged();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport.6
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import java.util.Iterator;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.IStaleListener;
import org.eclipse.core.databinding.observable.StaleEvent;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.core.databinding.util.ILogger;
import org.eclipse.core.databinding.util.Policy;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

public class DialogPageSupport
{
  private DialogPage dialogPage;
  private DataBindingContext dbc;
  
  public static DialogPageSupport create(DialogPage dialogPage, DataBindingContext dbc)
  {
    return new DialogPageSupport(dialogPage, dbc);
  }
  
  private IValidationMessageProvider messageProvider = new ValidationMessageProvider();
  private IObservableValue aggregateStatusProvider;
  private boolean uiChanged = false;
  private IChangeListener uiChangeListener = new IChangeListener()
  {
    public void handleChange(ChangeEvent event)
    {
      handleUIChanged();
    }
  };
  private IListChangeListener validationStatusProvidersListener = new IListChangeListener()
  {
    public void handleListChange(ListChangeEvent event)
    {
      ListDiff diff = diff;
      ListDiffEntry[] differences = diff.getDifferences();
      for (int i = 0; i < differences.length; i++)
      {
        ListDiffEntry listDiffEntry = differences[i];
        ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)listDiffEntry
          .getElement();
        IObservableList targets = validationStatusProvider.getTargets();
        if (listDiffEntry.isAddition())
        {
          targets.addListChangeListener(validationStatusProviderTargetsListener);
          for (Iterator it = targets.iterator(); it.hasNext();) {
            ((IObservable)it.next()).addChangeListener(uiChangeListener);
          }
        }
        else
        {
          targets.removeListChangeListener(validationStatusProviderTargetsListener);
          for (Iterator it = targets.iterator(); it.hasNext();) {
            ((IObservable)it.next()).removeChangeListener(uiChangeListener);
          }
        }
      }
    }
  };
  private IListChangeListener validationStatusProviderTargetsListener = new IListChangeListener()
  {
    public void handleListChange(ListChangeEvent event)
    {
      ListDiff diff = diff;
      ListDiffEntry[] differences = diff.getDifferences();
      for (int i = 0; i < differences.length; i++)
      {
        ListDiffEntry listDiffEntry = differences[i];
        IObservable target = (IObservable)listDiffEntry.getElement();
        if (listDiffEntry.isAddition()) {
          target.addChangeListener(uiChangeListener);
        } else {
          target.removeChangeListener(uiChangeListener);
        }
      }
    }
  };
  private ValidationStatusProvider currentStatusProvider;
  protected IStatus currentStatus;
  protected boolean currentStatusStale;
  
  protected DialogPageSupport(DialogPage dialogPage, DataBindingContext dbc)
  {
    this.dialogPage = dialogPage;
    this.dbc = dbc;
    init();
  }
  
  public void setValidationMessageProvider(IValidationMessageProvider messageProvider)
  {
    this.messageProvider = messageProvider;
    handleStatusChanged();
  }
  
  protected DialogPage getDialogPage()
  {
    return dialogPage;
  }
  
  /* Error */
  protected void init()
  {
    // Byte code:
    //   0: iconst_1
    //   1: invokestatic 246	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   4: aload_0
    //   5: new 126	org/eclipse/jface/databinding/dialog/MaxSeverityValidationStatusProvider
    //   8: dup
    //   9: aload_0
    //   10: getfield 229	org/eclipse/jface/databinding/dialog/DialogPageSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   13: invokespecial 263	org/eclipse/jface/databinding/dialog/MaxSeverityValidationStatusProvider:<init>	(Lorg/eclipse/core/databinding/DataBindingContext;)V
    //   16: putfield 234	org/eclipse/jface/databinding/dialog/DialogPageSupport:aggregateStatusProvider	Lorg/eclipse/core/databinding/observable/value/IObservableValue;
    //   19: goto +10 -> 29
    //   22: astore_1
    //   23: iconst_0
    //   24: invokestatic 246	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   27: aload_1
    //   28: athrow
    //   29: iconst_0
    //   30: invokestatic 246	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   33: aload_0
    //   34: getfield 234	org/eclipse/jface/databinding/dialog/DialogPageSupport:aggregateStatusProvider	Lorg/eclipse/core/databinding/observable/value/IObservableValue;
    //   37: new 122	org/eclipse/jface/databinding/dialog/DialogPageSupport$4
    //   40: dup
    //   41: aload_0
    //   42: invokespecial 260	org/eclipse/jface/databinding/dialog/DialogPageSupport$4:<init>	(Lorg/eclipse/jface/databinding/dialog/DialogPageSupport;)V
    //   45: invokeinterface 281 2 0
    //   50: aload_0
    //   51: getfield 237	org/eclipse/jface/databinding/dialog/DialogPageSupport:dialogPage	Lorg/eclipse/jface/dialogs/DialogPage;
    //   54: invokevirtual 268	org/eclipse/jface/dialogs/DialogPage:getShell	()Lorg/eclipse/swt/widgets/Shell;
    //   57: bipush 12
    //   59: new 123	org/eclipse/jface/databinding/dialog/DialogPageSupport$5
    //   62: dup
    //   63: aload_0
    //   64: invokespecial 261	org/eclipse/jface/databinding/dialog/DialogPageSupport$5:<init>	(Lorg/eclipse/jface/databinding/dialog/DialogPageSupport;)V
    //   67: invokevirtual 269	org/eclipse/swt/widgets/Widget:addListener	(ILorg/eclipse/swt/widgets/Listener;)V
    //   70: aload_0
    //   71: getfield 234	org/eclipse/jface/databinding/dialog/DialogPageSupport:aggregateStatusProvider	Lorg/eclipse/core/databinding/observable/value/IObservableValue;
    //   74: new 124	org/eclipse/jface/databinding/dialog/DialogPageSupport$6
    //   77: dup
    //   78: aload_0
    //   79: invokespecial 262	org/eclipse/jface/databinding/dialog/DialogPageSupport$6:<init>	(Lorg/eclipse/jface/databinding/dialog/DialogPageSupport;)V
    //   82: invokeinterface 276 2 0
    //   87: aload_0
    //   88: invokespecial 253	org/eclipse/jface/databinding/dialog/DialogPageSupport:statusProviderChanged	()V
    //   91: aload_0
    //   92: getfield 229	org/eclipse/jface/databinding/dialog/DialogPageSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   95: invokevirtual 243	org/eclipse/core/databinding/DataBindingContext:getValidationStatusProviders	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   98: aload_0
    //   99: getfield 233	org/eclipse/jface/databinding/dialog/DialogPageSupport:validationStatusProvidersListener	Lorg/eclipse/core/databinding/observable/list/IListChangeListener;
    //   102: invokeinterface 278 2 0
    //   107: aload_0
    //   108: getfield 229	org/eclipse/jface/databinding/dialog/DialogPageSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   111: invokevirtual 243	org/eclipse/core/databinding/DataBindingContext:getValidationStatusProviders	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   114: invokeinterface 277 1 0
    //   119: astore_1
    //   120: goto +68 -> 188
    //   123: aload_1
    //   124: invokeinterface 271 1 0
    //   129: checkcast 108	org/eclipse/core/databinding/ValidationStatusProvider
    //   132: astore_2
    //   133: aload_2
    //   134: invokevirtual 244	org/eclipse/core/databinding/ValidationStatusProvider:getTargets	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   137: astore_3
    //   138: aload_3
    //   139: aload_0
    //   140: getfield 232	org/eclipse/jface/databinding/dialog/DialogPageSupport:validationStatusProviderTargetsListener	Lorg/eclipse/core/databinding/observable/list/IListChangeListener;
    //   143: invokeinterface 278 2 0
    //   148: aload_3
    //   149: invokeinterface 277 1 0
    //   154: astore 4
    //   156: goto +22 -> 178
    //   159: aload 4
    //   161: invokeinterface 271 1 0
    //   166: checkcast 109	org/eclipse/core/databinding/observable/IObservable
    //   169: aload_0
    //   170: getfield 231	org/eclipse/jface/databinding/dialog/DialogPageSupport:uiChangeListener	Lorg/eclipse/core/databinding/observable/IChangeListener;
    //   173: invokeinterface 274 2 0
    //   178: aload 4
    //   180: invokeinterface 270 1 0
    //   185: ifne -26 -> 159
    //   188: aload_1
    //   189: invokeinterface 270 1 0
    //   194: ifne -71 -> 123
    //   197: return
    // Line number table:
    //   Java source line #166	-> byte code offset #0
    //   Java source line #168	-> byte code offset #4
    //   Java source line #169	-> byte code offset #9
    //   Java source line #168	-> byte code offset #16
    //   Java source line #170	-> byte code offset #22
    //   Java source line #171	-> byte code offset #23
    //   Java source line #172	-> byte code offset #27
    //   Java source line #171	-> byte code offset #29
    //   Java source line #174	-> byte code offset #33
    //   Java source line #175	-> byte code offset #37
    //   Java source line #180	-> byte code offset #50
    //   Java source line #185	-> byte code offset #70
    //   Java source line #191	-> byte code offset #87
    //   Java source line #192	-> byte code offset #91
    //   Java source line #193	-> byte code offset #98
    //   Java source line #192	-> byte code offset #102
    //   Java source line #194	-> byte code offset #107
    //   Java source line #196	-> byte code offset #123
    //   Java source line #197	-> byte code offset #124
    //   Java source line #196	-> byte code offset #129
    //   Java source line #198	-> byte code offset #133
    //   Java source line #199	-> byte code offset #138
    //   Java source line #200	-> byte code offset #139
    //   Java source line #201	-> byte code offset #148
    //   Java source line #202	-> byte code offset #159
    //   Java source line #201	-> byte code offset #178
    //   Java source line #194	-> byte code offset #188
    //   Java source line #195	-> byte code offset #189
    //   Java source line #194	-> byte code offset #194
    //   Java source line #205	-> byte code offset #197
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	198	0	this	DialogPageSupport
    //   22	6	1	localObject	Object
    //   119	70	1	it	Iterator
    //   132	2	2	validationStatusProvider	ValidationStatusProvider
    //   137	12	3	targets	IObservableList
    //   154	25	4	iter	Iterator
    // Exception table:
    //   from	to	target	type
    //   4	22	22	finally
  }
  
  private void statusProviderChanged()
  {
    currentStatusProvider = 
      ((ValidationStatusProvider)aggregateStatusProvider.getValue());
    if (currentStatusProvider != null) {
      currentStatus = 
        ((IStatus)currentStatusProvider.getValidationStatus().getValue());
    } else {
      currentStatus = null;
    }
    currentStatusStale = aggregateStatusProvider.isStale();
    handleStatusChanged();
  }
  
  protected void handleUIChanged()
  {
    uiChanged = true;
    if (currentStatus != null) {
      handleStatusChanged();
    }
    dbc.getValidationStatusProviders().removeListChangeListener(
      validationStatusProvidersListener);
    Iterator iter;
    for (Iterator it = dbc.getValidationStatusProviders().iterator(); it
          .hasNext(); iter.hasNext())
    {
      ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)it
        .next();
      IObservableList targets = validationStatusProvider.getTargets();
      targets
        .removeListChangeListener(validationStatusProviderTargetsListener);
      iter = targets.iterator(); continue;
      ((IObservable)iter.next())
        .removeChangeListener(uiChangeListener);
    }
  }
  
  protected void handleStatusChanged()
  {
    String message = messageProvider.getMessage(currentStatusProvider);
    int type = messageProvider.getMessageType(currentStatusProvider);
    if (type == 3)
    {
      dialogPage.setMessage(null);
      dialogPage.setErrorMessage(uiChanged ? message : null);
      if ((currentStatus != null) && (currentStatusHasException())) {
        handleStatusException();
      }
    }
    else
    {
      dialogPage.setErrorMessage(null);
      dialogPage.setMessage(message, type);
    }
  }
  
  private boolean currentStatusHasException()
  {
    boolean hasException = false;
    if (currentStatus.getException() != null) {
      hasException = true;
    }
    if ((currentStatus instanceof MultiStatus))
    {
      MultiStatus multiStatus = (MultiStatus)currentStatus;
      for (int i = 0; i < multiStatus.getChildren().length; i++)
      {
        IStatus status = multiStatus.getChildren()[i];
        if (status.getException() != null)
        {
          hasException = true;
          break;
        }
      }
    }
    return hasException;
  }
  
  protected void handleStatusException()
  {
    if (currentStatus.getException() != null)
    {
      logThrowable(currentStatus.getException());
    }
    else if ((currentStatus instanceof MultiStatus))
    {
      MultiStatus multiStatus = (MultiStatus)currentStatus;
      for (int i = 0; i < multiStatus.getChildren().length; i++)
      {
        IStatus status = multiStatus.getChildren()[i];
        if (status.getException() != null) {
          logThrowable(status.getException());
        }
      }
    }
  }
  
  private void logThrowable(Throwable throwable)
  {
    Policy.getLog().log(
      new Status(
      4, 
      "org.eclipse.core.databinding", 
      0, 
      "Unhandled exception: " + throwable.getMessage(), throwable));
  }
  
  public void dispose()
  {
    if (aggregateStatusProvider != null) {
      aggregateStatusProvider.dispose();
    }
    if ((dbc != null) && (!uiChanged))
    {
      Iterator iter;
      for (Iterator it = dbc.getValidationStatusProviders().iterator(); it
            .hasNext(); iter.hasNext())
      {
        ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)it
          .next();
        IObservableList targets = validationStatusProvider.getTargets();
        targets
          .removeListChangeListener(validationStatusProviderTargetsListener);
        iter = targets.iterator(); continue;
        ((IObservable)iter.next())
          .removeChangeListener(uiChangeListener);
      }
      dbc.getValidationStatusProviders().removeListChangeListener(
        validationStatusProvidersListener);
    }
    aggregateStatusProvider = null;
    dbc = null;
    uiChangeListener = null;
    validationStatusProvidersListener = null;
    validationStatusProviderTargetsListener = null;
    dialogPage = null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.DialogPageSupport
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.ValidationStatusProvider;

public abstract interface IValidationMessageProvider
{
  public abstract String getMessage(ValidationStatusProvider paramValidationStatusProvider);
  
  public abstract int getMessageType(ValidationStatusProvider paramValidationStatusProvider);
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.IValidationMessageProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.observable.value.ComputedValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.IStatus;

class MaxSeverityValidationStatusProvider
  extends ComputedValue
{
  private Collection validationStatusProviders;
  
  public MaxSeverityValidationStatusProvider(DataBindingContext dbc)
  {
    super(ValidationStatusProvider.class);
    validationStatusProviders = dbc.getValidationStatusProviders();
  }
  
  protected Object calculate()
  {
    int maxSeverity = 0;
    ValidationStatusProvider maxSeverityProvider = null;
    for (Iterator it = validationStatusProviders.iterator(); it.hasNext();)
    {
      ValidationStatusProvider provider = (ValidationStatusProvider)it
        .next();
      IStatus status = (IStatus)provider.getValidationStatus()
        .getValue();
      if (status.getSeverity() > maxSeverity)
      {
        maxSeverity = status.getSeverity();
        maxSeverityProvider = provider;
      }
    }
    return maxSeverityProvider;
  }
  
  public synchronized void dispose()
  {
    validationStatusProviders = null;
    super.dispose();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.MaxSeverityValidationStatusProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;

class TitleAreaDialogSupport$1
  implements IChangeListener
{
  final TitleAreaDialogSupport this$0;
  
  TitleAreaDialogSupport$1(TitleAreaDialogSupport paramTitleAreaDialogSupport)
  {
    this$0 = paramTitleAreaDialogSupport;
  }
  
  public void handleChange(ChangeEvent event)
  {
    TitleAreaDialogSupport.access$0(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import java.util.Iterator;
import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;

class TitleAreaDialogSupport$2
  implements IListChangeListener
{
  final TitleAreaDialogSupport this$0;
  
  TitleAreaDialogSupport$2(TitleAreaDialogSupport paramTitleAreaDialogSupport)
  {
    this$0 = paramTitleAreaDialogSupport;
  }
  
  public void handleListChange(ListChangeEvent event)
  {
    ListDiff diff = diff;
    ListDiffEntry[] differences = diff.getDifferences();
    for (int i = 0; i < differences.length; i++)
    {
      ListDiffEntry listDiffEntry = differences[i];
      ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)listDiffEntry
        .getElement();
      IObservableList targets = validationStatusProvider.getTargets();
      if (listDiffEntry.isAddition())
      {
        targets.addListChangeListener(TitleAreaDialogSupport.access$1(this$0));
        for (Iterator it = targets.iterator(); it.hasNext();) {
          ((IObservable)it.next()).addChangeListener(TitleAreaDialogSupport.access$2(this$0));
        }
      }
      else
      {
        targets.removeListChangeListener(TitleAreaDialogSupport.access$1(this$0));
        for (Iterator it = targets.iterator(); it.hasNext();) {
          ((IObservable)it.next()).removeChangeListener(TitleAreaDialogSupport.access$2(this$0));
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport.2
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;

class TitleAreaDialogSupport$3
  implements IListChangeListener
{
  final TitleAreaDialogSupport this$0;
  
  TitleAreaDialogSupport$3(TitleAreaDialogSupport paramTitleAreaDialogSupport)
  {
    this$0 = paramTitleAreaDialogSupport;
  }
  
  public void handleListChange(ListChangeEvent event)
  {
    ListDiff diff = diff;
    ListDiffEntry[] differences = diff.getDifferences();
    for (int i = 0; i < differences.length; i++)
    {
      ListDiffEntry listDiffEntry = differences[i];
      IObservable target = (IObservable)listDiffEntry.getElement();
      if (listDiffEntry.isAddition()) {
        target.addChangeListener(TitleAreaDialogSupport.access$2(this$0));
      } else {
        target.removeChangeListener(TitleAreaDialogSupport.access$2(this$0));
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport.3
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;

class TitleAreaDialogSupport$4
  implements IValueChangeListener
{
  final TitleAreaDialogSupport this$0;
  
  TitleAreaDialogSupport$4(TitleAreaDialogSupport paramTitleAreaDialogSupport)
  {
    this$0 = paramTitleAreaDialogSupport;
  }
  
  public void handleValueChange(ValueChangeEvent event)
  {
    TitleAreaDialogSupport.access$3(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport.4
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class TitleAreaDialogSupport$5
  implements DisposeListener
{
  final TitleAreaDialogSupport this$0;
  
  TitleAreaDialogSupport$5(TitleAreaDialogSupport paramTitleAreaDialogSupport)
  {
    this$0 = paramTitleAreaDialogSupport;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    this$0.dispose();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport.5
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jface.databinding.dialog;

import java.util.Iterator;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IListChangeListener;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.list.ListChangeEvent;
import org.eclipse.core.databinding.observable.list.ListDiff;
import org.eclipse.core.databinding.observable.list.ListDiffEntry;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.core.databinding.util.ILogger;
import org.eclipse.core.databinding.util.Policy;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Widget;

public class TitleAreaDialogSupport
{
  private TitleAreaDialog dialog;
  private DataBindingContext dbc;
  
  public static TitleAreaDialogSupport create(TitleAreaDialog dialog, DataBindingContext dbc)
  {
    return new TitleAreaDialogSupport(dialog, dbc);
  }
  
  private IValidationMessageProvider messageProvider = new ValidationMessageProvider();
  private IObservableValue aggregateStatusProvider;
  private boolean uiChanged = false;
  private IChangeListener uiChangeListener = new IChangeListener()
  {
    public void handleChange(ChangeEvent event)
    {
      TitleAreaDialogSupport.this.handleUIChanged();
    }
  };
  private IListChangeListener validationStatusProvidersListener = new IListChangeListener()
  {
    public void handleListChange(ListChangeEvent event)
    {
      ListDiff diff = diff;
      ListDiffEntry[] differences = diff.getDifferences();
      for (int i = 0; i < differences.length; i++)
      {
        ListDiffEntry listDiffEntry = differences[i];
        ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)listDiffEntry
          .getElement();
        IObservableList targets = validationStatusProvider.getTargets();
        if (listDiffEntry.isAddition())
        {
          targets.addListChangeListener(validationStatusProviderTargetsListener);
          for (Iterator it = targets.iterator(); it.hasNext();) {
            ((IObservable)it.next()).addChangeListener(uiChangeListener);
          }
        }
        else
        {
          targets.removeListChangeListener(validationStatusProviderTargetsListener);
          for (Iterator it = targets.iterator(); it.hasNext();) {
            ((IObservable)it.next()).removeChangeListener(uiChangeListener);
          }
        }
      }
    }
  };
  private IListChangeListener validationStatusProviderTargetsListener = new IListChangeListener()
  {
    public void handleListChange(ListChangeEvent event)
    {
      ListDiff diff = diff;
      ListDiffEntry[] differences = diff.getDifferences();
      for (int i = 0; i < differences.length; i++)
      {
        ListDiffEntry listDiffEntry = differences[i];
        IObservable target = (IObservable)listDiffEntry.getElement();
        if (listDiffEntry.isAddition()) {
          target.addChangeListener(uiChangeListener);
        } else {
          target.removeChangeListener(uiChangeListener);
        }
      }
    }
  };
  private ValidationStatusProvider currentStatusProvider;
  private IStatus currentStatus;
  
  private TitleAreaDialogSupport(TitleAreaDialog dialogPage, DataBindingContext dbc)
  {
    dialog = dialogPage;
    this.dbc = dbc;
    init();
  }
  
  public void setValidationMessageProvider(IValidationMessageProvider messageProvider)
  {
    this.messageProvider = messageProvider;
    handleStatusChanged();
  }
  
  /* Error */
  private void init()
  {
    // Byte code:
    //   0: iconst_1
    //   1: invokestatic 241	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   4: aload_0
    //   5: new 118	org/eclipse/jface/databinding/dialog/MaxSeverityValidationStatusProvider
    //   8: dup
    //   9: aload_0
    //   10: getfield 224	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   13: invokespecial 245	org/eclipse/jface/databinding/dialog/MaxSeverityValidationStatusProvider:<init>	(Lorg/eclipse/core/databinding/DataBindingContext;)V
    //   16: putfield 229	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:aggregateStatusProvider	Lorg/eclipse/core/databinding/observable/value/IObservableValue;
    //   19: goto +10 -> 29
    //   22: astore_1
    //   23: iconst_0
    //   24: invokestatic 241	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   27: aload_1
    //   28: athrow
    //   29: iconst_0
    //   30: invokestatic 241	org/eclipse/core/databinding/observable/ObservableTracker:setIgnore	(Z)V
    //   33: aload_0
    //   34: getfield 229	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:aggregateStatusProvider	Lorg/eclipse/core/databinding/observable/value/IObservableValue;
    //   37: new 123	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport$4
    //   40: dup
    //   41: aload_0
    //   42: invokespecial 257	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport$4:<init>	(Lorg/eclipse/jface/databinding/dialog/TitleAreaDialogSupport;)V
    //   45: invokeinterface 275 2 0
    //   50: aload_0
    //   51: getfield 232	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:dialog	Lorg/eclipse/jface/dialogs/TitleAreaDialog;
    //   54: invokevirtual 263	org/eclipse/jface/window/Window:getShell	()Lorg/eclipse/swt/widgets/Shell;
    //   57: new 124	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport$5
    //   60: dup
    //   61: aload_0
    //   62: invokespecial 258	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport$5:<init>	(Lorg/eclipse/jface/databinding/dialog/TitleAreaDialogSupport;)V
    //   65: invokevirtual 265	org/eclipse/swt/widgets/Widget:addDisposeListener	(Lorg/eclipse/swt/events/DisposeListener;)V
    //   68: aload_0
    //   69: invokespecial 250	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:statusProviderChanged	()V
    //   72: aload_0
    //   73: getfield 224	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   76: invokevirtual 238	org/eclipse/core/databinding/DataBindingContext:getValidationStatusProviders	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   79: aload_0
    //   80: getfield 228	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:validationStatusProvidersListener	Lorg/eclipse/core/databinding/observable/list/IListChangeListener;
    //   83: invokeinterface 272 2 0
    //   88: aload_0
    //   89: getfield 224	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:dbc	Lorg/eclipse/core/databinding/DataBindingContext;
    //   92: invokevirtual 238	org/eclipse/core/databinding/DataBindingContext:getValidationStatusProviders	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   95: invokeinterface 271 1 0
    //   100: astore_1
    //   101: goto +68 -> 169
    //   104: aload_1
    //   105: invokeinterface 267 1 0
    //   110: checkcast 107	org/eclipse/core/databinding/ValidationStatusProvider
    //   113: astore_2
    //   114: aload_2
    //   115: invokevirtual 239	org/eclipse/core/databinding/ValidationStatusProvider:getTargets	()Lorg/eclipse/core/databinding/observable/list/IObservableList;
    //   118: astore_3
    //   119: aload_3
    //   120: aload_0
    //   121: getfield 227	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:validationStatusProviderTargetsListener	Lorg/eclipse/core/databinding/observable/list/IListChangeListener;
    //   124: invokeinterface 272 2 0
    //   129: aload_3
    //   130: invokeinterface 271 1 0
    //   135: astore 4
    //   137: goto +22 -> 159
    //   140: aload 4
    //   142: invokeinterface 267 1 0
    //   147: checkcast 108	org/eclipse/core/databinding/observable/IObservable
    //   150: aload_0
    //   151: getfield 226	org/eclipse/jface/databinding/dialog/TitleAreaDialogSupport:uiChangeListener	Lorg/eclipse/core/databinding/observable/IChangeListener;
    //   154: invokeinterface 269 2 0
    //   159: aload 4
    //   161: invokeinterface 266 1 0
    //   166: ifne -26 -> 140
    //   169: aload_1
    //   170: invokeinterface 266 1 0
    //   175: ifne -71 -> 104
    //   178: return
    // Line number table:
    //   Java source line #150	-> byte code offset #0
    //   Java source line #152	-> byte code offset #4
    //   Java source line #153	-> byte code offset #9
    //   Java source line #152	-> byte code offset #16
    //   Java source line #154	-> byte code offset #22
    //   Java source line #155	-> byte code offset #23
    //   Java source line #156	-> byte code offset #27
    //   Java source line #155	-> byte code offset #29
    //   Java source line #158	-> byte code offset #33
    //   Java source line #159	-> byte code offset #37
    //   Java source line #164	-> byte code offset #50
    //   Java source line #169	-> byte code offset #68
    //   Java source line #170	-> byte code offset #72
    //   Java source line #171	-> byte code offset #79
    //   Java source line #170	-> byte code offset #83
    //   Java source line #172	-> byte code offset #88
    //   Java source line #174	-> byte code offset #104
    //   Java source line #175	-> byte code offset #105
    //   Java source line #174	-> byte code offset #110
    //   Java source line #176	-> byte code offset #114
    //   Java source line #177	-> byte code offset #119
    //   Java source line #178	-> byte code offset #120
    //   Java source line #179	-> byte code offset #129
    //   Java source line #180	-> byte code offset #140
    //   Java source line #179	-> byte code offset #159
    //   Java source line #172	-> byte code offset #169
    //   Java source line #173	-> byte code offset #170
    //   Java source line #172	-> byte code offset #175
    //   Java source line #183	-> byte code offset #178
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	179	0	this	TitleAreaDialogSupport
    //   22	6	1	localObject	Object
    //   100	70	1	it	Iterator
    //   113	2	2	validationStatusPro
1 2 3 4 5 6 7 8 9 10 11

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