org.eclipse.team.ui_3.6.101.R37x_v20111109-0800

is.message = message;
    this.description = description;
    this.scope = scope;
  }
  
  protected void initializeStyle() {}
  
  protected Composite createDropDownDialogArea(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    marginHeight = convertVerticalDLUsToPixels(7);
    marginWidth = convertHorizontalDLUsToPixels(7);
    verticalSpacing = convertVerticalDLUsToPixels(4);
    horizontalSpacing = convertHorizontalDLUsToPixels(4);
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(1808));
    selectedMappingsArea = ResourceMappingHierarchyArea.create(scope, null);
    selectedMappingsArea.setDescription(description);
    selectedMappingsArea.createArea(composite);
    return composite;
  }
  
  protected void createMainDialogArea(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    numColumns = 2;
    composite.setLayout(layout);
    createMessageArea(composite);
  }
  
  protected void updateEnablements() {}
  
  private Control createMessageArea(Composite composite)
  {
    Image image = getSWTImage(2);
    if (image != null)
    {
      imageLabel = new Label(composite, 0);
      image.setBackground(imageLabel.getBackground());
      imageLabel.setImage(image);
      imageLabel.setLayoutData(new GridData(
        66));
    }
    if (message != null)
    {
      messageLabel = new Label(composite, 64);
      messageLabel.setText(message);
      GridData data = new GridData(770);
      
      widthHint = convertHorizontalDLUsToPixels(300);
      messageLabel.setLayoutData(data);
    }
    return composite;
  }
  
  private Image getSWTImage(int imageID)
  {
    Shell shell = getShell();
    if (shell == null) {
      shell = getParentShell();
    }
    Display display;
    Display display;
    if (shell == null) {
      display = Display.getCurrent();
    } else {
      display = shell.getDisplay();
    }
    Image[] image = new Image[1];
    display.syncExec(new Runnable()
    {
      private final Image[] val$image;
      private final Display val$display;
      private final int val$imageID;
      
      public void run()
      {
        val$image[0] = val$display.getSystemImage(val$imageID);
      }
    });
    return image[0];
  }
  
  public boolean isHelpAvailable()
  {
    return false;
  }
  
  protected boolean includeCancelButton()
  {
    return false;
  }
  
  public static void open(Shell shell, String title, String message, String description, ISynchronizationScope scope)
  {
    new NoChangesDialog(shell, title, message, description, scope).open();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.NoChangesDialog
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.events.HelpEvent;
import org.eclipse.swt.events.HelpListener;

class PreferencePageContainerDialog$1
  implements HelpListener
{
  final PreferencePageContainerDialog this$0;
  
  PreferencePageContainerDialog$1(PreferencePageContainerDialog paramPreferencePageContainerDialog)
  {
    this$0 = paramPreferencePageContainerDialog;
  }
  
  public void helpRequested(HelpEvent e)
  {
    PreferencePageContainerDialog.access$0(this$0).performHelp();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class PreferencePageContainerDialog$2
  extends SelectionAdapter
{
  final PreferencePageContainerDialog this$0;
  
  PreferencePageContainerDialog$2(PreferencePageContainerDialog paramPreferencePageContainerDialog)
  {
    this$0 = paramPreferencePageContainerDialog;
  }
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.updatePageSelection();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

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

class PreferencePageContainerDialog$3
  implements IPropertyChangeListener
{
  final PreferencePageContainerDialog this$0;
  
  PreferencePageContainerDialog$3(PreferencePageContainerDialog paramPreferencePageContainerDialog)
  {
    this$0 = paramPreferencePageContainerDialog;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (("org.eclipse.jface.bannerfont".equals(event.getProperty())) || 
      ("org.eclipse.jface.dialogfont".equals(event.getProperty()))) {
      this$0.updateMessage();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class PreferencePageContainerDialog$4
  implements DisposeListener
{
  final PreferencePageContainerDialog this$0;
  private final IPropertyChangeListener val$fontListener;
  
  PreferencePageContainerDialog$4(PreferencePageContainerDialog paramPreferencePageContainerDialog, IPropertyChangeListener paramIPropertyChangeListener)
  {
    this$0 = paramPreferencePageContainerDialog;val$fontListener = paramIPropertyChangeListener;
  }
  
  public void widgetDisposed(DisposeEvent event)
  {
    JFaceResources.getFontRegistry().removeListener(val$fontListener);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.jface.dialogs.IPageChangedListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
import org.eclipse.jface.util.SafeRunnable;

class PreferencePageContainerDialog$5
  extends SafeRunnable
{
  final PreferencePageContainerDialog this$0;
  private final IPageChangedListener val$l;
  private final PageChangedEvent val$event;
  
  PreferencePageContainerDialog$5(PreferencePageContainerDialog paramPreferencePageContainerDialog, IPageChangedListener paramIPageChangedListener, PageChangedEvent paramPageChangedEvent)
  {
    this$0 = paramPreferencePageContainerDialog;val$l = paramIPageChangedListener;val$event = paramPageChangedEvent;
  }
  
  public void run()
  {
    val$l.pageChanged(val$event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IPageChangeProvider;
import org.eclipse.jface.dialogs.IPageChangedListener;
import org.eclipse.jface.dialogs.PageChangedEvent;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferencePageContainer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.HelpEvent;
import org.eclipse.swt.events.HelpListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
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.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;

public class PreferencePageContainerDialog
  extends TrayDialog
  implements IPreferencePageContainer, IPageChangeProvider
{
  private PreferencePage[] pages;
  private PreferencePage currentPage;
  private Composite fTitleArea;
  private Label fTitleImage;
  private CLabel fMessageLabel;
  private String fMessage;
  private Color fNormalMsgAreaBackground;
  private Image fErrorMsgImage;
  private Button fOkButton;
  private ListenerList pageChangedListeners = new ListenerList();
  private Composite fPageContainer;
  private Point fMinimumPageSize = new Point(200, 200);
  private TabFolder tabFolder;
  private Map pageMap = new HashMap();
  protected static final String PREF_DLG_TITLE_IMG = "preference_page_container_image";
  protected static final String PREF_DLG_IMG_TITLE_ERROR = "preference_page_container_title_error_image";
  
  static
  {
    ImageRegistry reg = TeamUIPlugin.getPlugin().getImageRegistry();
    reg.put("preference_page_container_image", ImageDescriptor.createFromFile(PreferenceDialog.class, "images/pref_dialog_title.gif"));
    reg.put("preference_page_container_title_error_image", ImageDescriptor.createFromFile(Dialog.class, "images/message_error.gif"));
  }
  
  public PreferencePageContainerDialog(Shell shell, PreferencePage[] pages)
  {
    super(shell);
    this.pages = pages;
  }
  
  protected void okPressed()
  {
    for (int i = 0; i < pages.length; i++)
    {
      PreferencePage page = pages[i];
      page.performOk();
    }
    handleSave();
    
    super.okPressed();
  }
  
  public void setTitle(String title)
  {
    Shell shell = getShell();
    if ((shell != null) && (!shell.isDisposed())) {
      shell.setText(title);
    }
  }
  
  protected Control createDialogArea(Composite parent)
  {
    Composite composite = (Composite)super.createDialogArea(parent);
    getLayoutnumColumns = 1;
    
    createDescriptionArea(composite);
    if (isSinglePage()) {
      createSinglePageArea(composite, pages[0]);
    } else {
      createMultiplePageArea(composite);
    }
    Label separator = new Label(composite, 258);
    GridData gd = new GridData(768);
    horizontalSpan = 2;
    separator.setLayoutData(gd);
    
    setTitle(TeamUIMessages.PreferencePageContainerDialog_6);
    applyDialogFont(parent);
    
    composite.addHelpListener(new HelpListener()
    {
      public void helpRequested(HelpEvent e)
      {
        currentPage.performHelp();
      }
    });
    return composite;
  }
  
  private void createMultiplePageArea(Composite composite)
  {
    tabFolder = new TabFolder(composite, 0);
    tabFolder.setLayoutData(new GridData(1808));
    for (int i = 0; i < pages.length; i++)
    {
      PreferencePage page = pages[i];
      
      TabItem tabItem = new TabItem(tabFolder, 0);
      tabItem.setText(page.getTitle());
      tabItem.setControl(createPageArea(tabFolder, page));
      pageMap.put(tabItem, page);
    }
    tabFolder.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        updatePageSelection();
      }
    });
    updatePageSelection();
  }
  
  protected void updatePageSelection()
  {
    TabItem[] items = tabFolder.getSelection();
    if (items.length == 1)
    {
      currentPage = ((PreferencePage)pageMap.get(items[0]));
      updateMessage();
    }
    firePageChanged(new PageChangedEvent(this, currentPage));
  }
  
  private boolean isSinglePage()
  {
    return pages.length == 1;
  }
  
  private void createSinglePageArea(Composite composite, PreferencePage page)
  {
    createPageArea(composite, page);
    currentPage = page;
    updateMessage();
  }
  
  private Control createPageArea(Composite composite, PreferencePage page)
  {
    fPageContainer = createPageContainer(composite);
    fPageContainer.setLayoutData(new GridData(1808));
    
    page.setContainer(this);
    page.createControl(fPageContainer);
    return fPageContainer;
  }
  
  private void createDescriptionArea(Composite composite)
  {
    Composite titleComposite = new Composite(composite, 0);
    GridLayout layout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    verticalSpacing = 0;
    horizontalSpacing = 0;
    titleComposite.setLayout(layout);
    titleComposite.setLayoutData(new GridData(768));
    
    createMessageArea(titleComposite);
    
    Label titleBarSeparator = new Label(titleComposite, 258);
    GridData gd = new GridData(768);
    titleBarSeparator.setLayoutData(gd);
  }
  
  private Composite createMessageArea(Composite parent)
  {
    fTitleArea = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    verticalSpacing = 0;
    horizontalSpacing = 0;
    numColumns = 2;
    
    Display display = parent.getDisplay();
    Color bg = JFaceColors.getBannerBackground(display);
    Color fg = JFaceColors.getBannerForeground(display);
    
    GridData layoutData = new GridData(1808);
    fTitleArea.setLayout(layout);
    fTitleArea.setLayoutData(layoutData);
    fTitleArea.setBackground(bg);
    
    fMessageLabel = new CLabel(fTitleArea, 16384);
    fMessageLabel.setBackground(bg);
    fMessageLabel.setForeground(fg);
    fMessageLabel.setText(" ");
    fMessageLabel.setFont(JFaceResources.getBannerFont());
    
    IPropertyChangeListener fontListener = new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent event)
      {
        if (("org.eclipse.jface.bannerfont".equals(event.getProperty())) || 
          ("org.eclipse.jface.dialogfont".equals(event.getProperty()))) {
          updateMessage();
        }
      }
    };
    fMessageLabel.addDisposeListener(new DisposeListener()
    {
      private final IPropertyChangeListener val$fontListener;
      
      public void widgetDisposed(DisposeEvent event)
      {
        JFaceResources.getFontRegistry().removeListener(val$fontListener);
      }
    });
    JFaceResources.getFontRegistry().addListener(fontListener);
    
    GridData gd = new GridData(1808);
    fMessageLabel.setLayoutData(gd);
    
    fTitleImage = new Label(fTitleArea, 16384);
    fTitleImage.setBackground(bg);
    fTitleImage.setImage(TeamUIPlugin.getPlugin().getImageRegistry().get("preference_page_container_image"));
    gd = new GridData();
    horizontalAlignment = 3;
    fTitleImage.setLayoutData(gd);
    updateMessage();
    return fTitleArea;
  }
  
  private Composite createPageContainer(Composite parent)
  {
    Composite result = new Composite(parent, 0);
    FillLayout layout = new FillLayout();
    marginHeight = 5;
    marginWidth = 5;
    result.setLayout(layout);
    return result;
  }
  
  public void setMinimumPageSize(Point size)
  {
    fMinimumPageSize.x = x;
    fMinimumPageSize.y = y;
  }
  
  public void setErrorMessage(String errorMessage)
  {
    if (errorMessage == null)
    {
      if (fMessageLabel.getImage() != null)
      {
        fMessageLabel.setBackground(fNormalMsgAreaBackground);
        fMessageLabel.setImage(null);
        fTitleImage.setImage(TeamUIPlugin.getPlugin().getImageRegistry().get("preference_page_container_image"));
        fTitleArea.layout(true);
      }
      setMessage(fMessage);
    }
    else
    {
      fMessageLabel.setText(errorMessage);
      if (fMessageLabel.getImage() == null)
      {
        if (fErrorMsgImage == null) {
          fErrorMsgImage = TeamUIPlugin.getPlugin().getImageRegistry().get("preference_page_container_title_error_image");
        }
        fNormalMsgAreaBackground = fMessageLabel.getBackground();
        fMessageLabel.setBackground(JFaceColors.getErrorBackground(fMessageLabel.getDisplay()));
        fMessageLabel.setImage(fErrorMsgImage);
        fTitleImage.setImage(null);
        fTitleArea.layout(true);
      }
    }
  }
  
  public void setMessage(String newMessage)
  {
    fMessage = newMessage;
    if (fMessage == null) {
      fMessage = "";
    }
    if (fMessageLabel.getImage() == null) {
      fMessageLabel.setText(fMessage);
    }
  }
  
  public void updateMessage()
  {
    if (currentPage != null)
    {
      String pageMessage = currentPage.getMessage();
      String pageErrorMessage = currentPage.getErrorMessage();
      if ((pageMessage == null) && (pageErrorMessage == null)) {
        fMessageLabel.setFont(JFaceResources.getBannerFont());
      } else {
        fMessageLabel.setFont(JFaceResources.getDialogFont());
      }
      if (pageMessage == null)
      {
        if (isSinglePage())
        {
          setMessage(TeamUIMessages.PreferencePageContainerDialog_6);
        }
        else
        {
          String title = currentPage.getTitle();
          title = title.replaceAll("&", "");
          setMessage(title);
        }
      }
      else {
        setMessage(pageMessage);
      }
      setErrorMessage(pageErrorMessage);
    }
  }
  
  public IPreferenceStore getPreferenceStore()
  {
    return null;
  }
  
  public void updateButtons()
  {
    if (fOkButton != null)
    {
      boolean isValid = true;
      for (int i = 0; i < pages.length; i++)
      {
        PreferencePage page = pages[i];
        if (!page.isValid())
        {
          isValid = false;
          break;
        }
      }
      fOkButton.setEnabled(isValid);
    }
  }
  
  public void updateTitle()
  {
    updateMessage();
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    fOkButton = createButton(parent, 0, IDialogConstants.OK_LABEL, true);
    createButton(parent, 1, IDialogConstants.CANCEL_LABEL, false);
  }
  
  protected void handleSave()
  {
    for (int i = 0; i < pages.length; i++)
    {
      PreferencePage page = pages[i];
      IPreferenceStore store = page.getPreferenceStore();
      if ((store != null) && 
        (store.needsSaving()) && 
        ((store instanceof IPersistentPreferenceStore))) {
        try
        {
          ((IPersistentPreferenceStore)store).save();
        }
        catch (IOException e)
        {
          Utils.handle(e);
        }
      }
    }
  }
  
  public void addPageChangedListener(IPageChangedListener listener)
  {
    pageChangedListeners.add(listener);
  }
  
  public Object getSelectedPage()
  {
    return currentPage;
  }
  
  public void removePageChangedListener(IPageChangedListener listener)
  {
    pageChangedListeners.remove(listener);
  }
  
  private void firePageChanged(PageChangedEvent event)
  {
    Object[] listeners = pageChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; i++)
    {
      IPageChangedListener l = (IPageChangedListener)listeners[i];
      SafeRunnable.run(new SafeRunnable()
      {
        private final IPageChangedListener val$l;
        private final PageChangedEvent val$event;
        
        public void run()
        {
          val$l.pageChanged(val$event);
        }
      });
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PreferencePageContainerDialog
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Shell;

class PromptingDialog$1
  implements IShellProvider
{
  private final Shell val$shell;
  
  PromptingDialog$1(Shell paramShell)
  {
    val$shell = paramShell;
  }
  
  public Shell getShell()
  {
    return val$shell;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PromptingDialog.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Shell;

public class PromptingDialog
  extends MultipleYesNoPrompter
{
  private IPromptCondition condition;
  private IResource[] resources;
  
  public PromptingDialog(Shell shell, IResource[] resources, IPromptCondition condition, String title)
  {
    this(shell, resources, condition, title, false);
  }
  
  public PromptingDialog(Shell shell, IResource[] resources, IPromptCondition condition, String title, boolean allOrNothing)
  {
    super(new IShellProvider()
    {
      public Shell getShell()
      {
        return PromptingDialog.this;
      }
    }, title, resources.length > 1, allOrNothing);
    this.resources = resources;
    this.condition = condition;
  }
  
  public IResource[] promptForMultiple()
    throws InterruptedException
  {
    List targetResources = new ArrayList();
    for (int i = 0; i < resources.length; i++)
    {
      IResource resource = resources[i];
      if ((!condition.needsPrompt(resource)) || (shouldInclude(condition.promptMessage(resource)))) {
        targetResources.add(resource);
      }
    }
    return (IResource[])targetResources.toArray(new IResource[targetResources.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.PromptingDialog
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.mapping.ISynchronizationContext;
import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.internal.ui.mapping.TeamViewerSorter;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.mapping.ITeamContentProviderManager;
import org.eclipse.ui.navigator.CommonViewer;
import org.eclipse.ui.navigator.CommonViewerSorter;
import org.eclipse.ui.navigator.IExtensionStateModel;
import org.eclipse.ui.navigator.INavigatorActivationService;
import org.eclipse.ui.navigator.INavigatorContentExtension;
import org.eclipse.ui.navigator.INavigatorContentService;
import org.eclipse.ui.navigator.INavigatorContentServiceListener;

public class ResourceMappingHierarchyArea
  extends DialogArea
  implements INavigatorContentServiceListener
{
  private static final String TEAM_NAVIGATOR_CONTENT = "org.eclipse.team.ui.navigatorViewer";
  private String description;
  private CommonViewer viewer;
  private final ISynchronizationScope scope;
  private final ISynchronizationContext context;
  
  public static ResourceMappingHierarchyArea create(ISynchronizationScope scope, ISynchronizationContext context)
  {
    return new ResourceMappingHierarchyArea(scope, context);
  }
  
  private ResourceMappingHierarchyArea(ISynchronizationScope scope, ISynchronizationContext context)
  {
    this.scope = scope;
    this.context = context;
  }
  
  public void createArea(Composite parent)
  {
    Composite composite = new Composite(parent, 0);
    GridLayout layout = new GridLayout(1, false);
    marginHeight = 0;
    marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(1808));
    if (description != null) {
      createWrappingLabel(composite, description, 1);
    }
    viewer = new CommonViewer("org.eclipse.team.ui.navigatorViewer", composite, 2048);
    viewer.setSorter(new CommonViewerSorter());
    viewer.setSorter(new TeamViewerSorter((CommonViewerSorter)viewer.getSorter()));
    viewer.getNavigatorContentService().bindExtensions(TeamUI.getTeamContentProviderManager().getContentProviderIds(scope), true);
    viewer.getNavigatorContentService().getActivationService().activateExtensions(TeamUI.getTeamContentProviderManager().getContentProviderIds(scope), true);
    GridData data = new GridData(1808);
    heightHint = 100;
    widthHint = 300;
    viewer.getControl().setLayoutData(data);
    viewer.getNavigatorContentService().addListener(this);
    viewer.setInput(getInitialInput());
    viewer.refresh();
    Object[] objects = getRootModelObjects();
    viewer.setSelection(new StructuredSelection(objects), true);
  }
  
  private Object getInitialInput()
  {
    if (context != null) {
      return context;
    }
    return scope;
  }
  
  private Object[] getRootModelObjects()
  {
    if (scope == null) {
      return new Object[0];
    }
    ResourceMapping[] mappings = scope.getMappings();
    List result = new ArrayList();
    for (int i = 0; i < mappings.length; i++)
    {
      ResourceMapping mapping = mappings[i];
      result.add(mapping.getModelObject());
    }
    return result.toArray(new Object[result.size()]);
  }
  
  public void setDescription(String string)
  {
    description = string;
  }
  
  public void onLoad(INavigatorContentExtension anExtension)
  {
    anExtension.getStateModel().setProperty("org.eclipse.team.ui.synchronizationScope", scope);
    if (context != null) {
      anExtension.getStateModel().setProperty("org.eclipse.team.ui.synchronizationContext", context);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingHierarchyArea
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.views.navigator.ResourceComparator;

class ResourceMappingResourceDisplayArea$1
  extends ResourceComparator
{
  final ResourceMappingResourceDisplayArea this$0;
  
  ResourceMappingResourceDisplayArea$1(ResourceMappingResourceDisplayArea paramResourceMappingResourceDisplayArea, int $anonymous0)
  {
    super($anonymous0);this$0 = paramResourceMappingResourceDisplayArea;
  }
  
  public int compare(Viewer viewer, Object o1, Object o2)
  {
    if (((o1 instanceof ResourceMappingResourceDisplayArea.ResourceTraversalElement)) && ((o2 instanceof ResourceMappingResourceDisplayArea.ResourceTraversalElement)))
    {
      ResourceMappingResourceDisplayArea.ResourceTraversalElement e1 = (ResourceMappingResourceDisplayArea.ResourceTraversalElement)o1;
      ResourceMappingResourceDisplayArea.ResourceTraversalElement e2 = (ResourceMappingResourceDisplayArea.ResourceTraversalElement)o2;
      return super.compare(viewer, e1.getResource(), e2.getResource());
    }
    return super.compare(viewer, o1, o2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingResourceDisplayArea.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.util.Map;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class ResourceMappingResourceDisplayArea$2
  implements IRunnableWithProgress
{
  final ResourceMappingResourceDisplayArea this$0;
  private final ResourceMapping val$mapping;
  private final ResourceMappingContext val$context;
  private final Map val$result;
  
  ResourceMappingResourceDisplayArea$2(ResourceMappingResourceDisplayArea paramResourceMappingResourceDisplayArea, ResourceMapping paramResourceMapping, ResourceMappingContext paramResourceMappingContext, Map paramMap)
  {
    this$0 = paramResourceMappingResourceDisplayArea;val$mapping = paramResourceMapping;val$context = paramResourceMappingContext;val$result = paramMap;
  }
  
  /* Error */
  public void run(IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: iconst_m1
    //   3: invokeinterface 91 3 0
    //   8: aload_0
    //   9: getfield 80	org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea$2:val$mapping	Lorg/eclipse/core/resources/mapping/ResourceMapping;
    //   12: aload_0
    //   13: getfield 81	org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea$2:val$context	Lorg/eclipse/core/resources/mapping/ResourceMappingContext;
    //   16: aload_1
    //   17: iconst_m1
    //   18: invokestatic 87	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   21: invokevirtual 85	org/eclipse/core/resources/mapping/ResourceMapping:getTraversals	(Lorg/eclipse/core/resources/mapping/ResourceMappingContext;Lorg/eclipse/core/runtime/IProgressMonitor;)[Lorg/eclipse/core/resources/mapping/ResourceTraversal;
    //   24: astore_2
    //   25: iconst_0
    //   26: istore_3
    //   27: goto +30 -> 57
    //   30: aload_2
    //   31: iload_3
    //   32: aaload
    //   33: astore 4
    //   35: aload_0
    //   36: aload_0
    //   37: getfield 80	org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea$2:val$mapping	Lorg/eclipse/core/resources/mapping/ResourceMapping;
    //   40: aload 4
    //   42: aload_1
    //   43: iconst_m1
    //   44: invokestatic 87	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   47: aload_0
    //   48: getfield 79	org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea$2:val$result	Ljava/util/Map;
    //   51: invokespecial 88	org/eclipse/team/internal/ui/dialogs/ResourceMappingResourceDisplayArea$2:buildFilteredResourceMap	(Lorg/eclipse/core/resources/mapping/ResourceMapping;Lorg/eclipse/core/resources/mapping/ResourceTraversal;Lorg/eclipse/core/runtime/IProgressMonitor;Ljava/util/Map;)V
    //   54: iinc 3 1
    //   57: iload_3
    //   58: aload_2
    //   59: arraylength
    //   60: if_icmplt -30 -> 30
    //   63: goto +24 -> 87
    //   66: astore_2
    //   67: new 39	java/lang/reflect/InvocationTargetException
    //   70: dup
    //   71: aload_2
    //   72: invokespecial 84	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
    //   75: athrow
    //   76: astore 5
    //   78: aload_1
    //   79: invokeinterface 90 1 0
    //   84: aload 5
    //   86: athrow
    //   87: aload_1
    //   88: invokeinterface 90 1 0
    //   93: return
    // Line number table:
    //   Java source line #323	-> byte code offset #0
    //   Java source line #324	-> byte code offset #8
    //   Java source line #325	-> byte code offset #25
    //   Java source line #326	-> byte code offset #30
    //   Java source line #327	-> byte code offset #35
    //   Java source line #325	-> byte code offset #54
    //   Java source line #329	-> byte code offset #66
    //   Java source line #330	-> byte code offset #67
    //   Java source line #331	-> byte code offset #76
    //   Java source line #332	-> byte code offset #78
    //   Java source line #333	-> byte code offset #84
    //   Java source line #332	-> byte code offset #87
    //   Java source line #334	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	this	2
    //   0	94	1	monitor	IProgressMonitor
    //   24	35	2	traversals	ResourceTraversal[]
    //   66	6	2	e	CoreException
    //   26	32	3	i	int
    //   33	8	4	traversal	ResourceTraversal
    //   76	9	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	63	66	org/eclipse/core/runtime/CoreException
    //   0	76	76	finally
  }
  
  private void buildFilteredResourceMap(ResourceMapping mapping, ResourceTraversal traversal, IProgressMonitor monitor, Map result)
    throws CoreException
  {
    traversal.accept(new ResourceMappingResourceDisplayArea.3(this, mapping, traversal, result));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingResourceDisplayArea.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.CoreException;

class ResourceMappingResourceDisplayArea$3
  implements IResourceVisitor
{
  final ResourceMappingResourceDisplayArea.2 this$1;
  private final ResourceMapping val$mapping;
  private final ResourceTraversal val$traversal;
  private final Map val$result;
  
  ResourceMappingResourceDisplayArea$3(ResourceMappingResourceDisplayArea.2 param2, ResourceMapping paramResourceMapping, ResourceTraversal paramResourceTraversal, Map paramMap)
  {
    this$1 = param2;val$mapping = paramResourceMapping;val$traversal = paramResourceTraversal;val$result = paramMap;
  }
  
  public boolean visit(IResource resource)
    throws CoreException
  {
    if (ResourceMappingResourceDisplayArea.access$2(ResourceMappingResourceDisplayArea.2.access$0(this$1)).select(resource, val$mapping, val$traversal))
    {
      val$result.put(resource, new ArrayList());
      
      IResource child = resource;
      while (!ResourceMappingResourceDisplayArea.isTraversalRoot(val$traversal, child))
      {
        IContainer parent = child.getParent();
        List children = (List)val$result.get(parent);
        if (children == null)
        {
          children = new ArrayList();
          val$result.put(parent, children);
        }
        children.add(child);
        child = parent;
      }
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingResourceDisplayArea.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class ResourceMappingResourceDisplayArea$4
  implements IRunnableWithProgress
{
  private final List val$traversals;
  private final ResourceMapping val$mapping;
  private final ResourceMappingContext val$context;
  
  ResourceMappingResourceDisplayArea$4(List paramList, ResourceMapping paramResourceMapping, ResourceMappingContext paramResourceMappingContext)
  {
    val$traversals = paramList;val$mapping = paramResourceMapping;val$context = paramResourceMappingContext;
  }
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    try
    {
      val$traversals.add(val$mapping.getTraversals(val$context, monitor));
    }
    catch (CoreException e)
    {
      throw new InvocationTargetException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingResourceDisplayArea.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.mapping.RemoteResourceMappingContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

class ResourceMappingResourceDisplayArea$5
  implements IRunnableWithProgress
{
  private final List val$members;
  private final RemoteResourceMappingContext val$context;
  private final IContainer val$container;
  
  ResourceMappingResourceDisplayArea$5(List paramList, RemoteResourceMappingContext paramRemoteResourceMappingContext, IContainer paramIContainer)
  {
    val$members = paramList;val$context = paramRemoteResourceMappingContext;val$container = paramIContainer;
  }
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    try
    {
      val$members.add(val$context.fetchMembers(val$container, monitor));
    }
    catch (CoreException e)
    {
      throw new InvocationTargetException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.dialogs.ResourceMappingResourceDisplayArea.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.internal.ui.dialogs;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.model.IWorkbenchAdapter;

public class ResourceMappingResourceDisplayArea$ResourceMappingElement
  implements IWorkbenchAdapter, IAdaptable
{
  private ResourceMapping mapping;
  private ResourceMappingContext context;
  final ResourceMappingResourceDisplayArea this$0;
  
  public ResourceMappingResourceDisplayArea$ResourceMappingElement(ResourceMappingResourceDisplayArea paramResourceMappingResourceDisplayArea, ResourceMapping mapping, ResourceMappingContext context)
  {
    this$0 = paramResourceMappingResourceDisplayArea;
    this.mapping = mapping;
    this.context = context;
  }
  
  public Object[] getChildren(Object o)
  {
    ResourceTraversal[] traversals = getTraversals();
    List result = new ArrayList();
    for (int i = 0; i < traversals.length; i++)
    {
      ResourceTraversal traversal = traversals[i];
      IResource[] resources = traversal.getResources();
      for (int j = 0; j < resources.length; j++)
      {
        IResource resource = resources[j];
        if (ResourceMappingResourceDisplayArea.access$0(this$0, resource, traversal)) {
          result.add(new ResourceMappingResourceDisplayArea.ResourceTraversalElement(this$0, this, traversal, resource, context));
        }
      }
    }
    return result.toArray(new Object[result.size()]);
  }
  
  private ResourceTraversal[] getTraversals()
  {
    return ResourceMappingResourceDisplayArea.getTraversals(mapping, context);
  }
  
  public ImageDescriptor getImageDescriptor(Object o)
  {
    o = mapping;
    IWorkbenchAdapter workbenchAdapter = ResourceMappingResourceDisplayArea.access$1((IAdaptable)o);
    if (workbenchAdapter == null)
    {
      Object modelObject = mapping.getModelObject();
   
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

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-2019. Infinite Loop Ltd