org.eclipse.ui.navigator_3.5.101.v20120106-1355

16:48:21.689 INFO  jd.cli.Main - Decompiling org.eclipse.ui.navigator_3.5.101.v20120106-1355.jar
package org.eclipse.ui.internal.navigator;

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;

public class AdaptabilityUtility
{
  public static Object getAdapter(Object anElement, Class anAdapterType)
  {
    Assert.isNotNull(anAdapterType);
    if (anElement == null) {
      return null;
    }
    if (anAdapterType.isInstance(anElement)) {
      return anElement;
    }
    if ((anElement instanceof IAdaptable))
    {
      IAdaptable adaptable = (IAdaptable)anElement;
      
      Object result = adaptable.getAdapter(anAdapterType);
      if (result != null)
      {
        Assert.isTrue(anAdapterType.isInstance(result));
        return result;
      }
    }
    if (!(anElement instanceof PlatformObject))
    {
      Object result = Platform.getAdapterManager().getAdapter(anElement, anAdapterType);
      if (result != null) {
        return result;
      }
    }
    return null;
  }
}

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

import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.internal.navigator.framelist.BackAction;
import org.eclipse.ui.internal.navigator.framelist.ForwardAction;
import org.eclipse.ui.internal.navigator.framelist.UpAction;
import org.eclipse.ui.navigator.CommonNavigator;

class CommonNavigatorActionGroup$1
  implements IPropertyChangeListener
{
  final CommonNavigatorActionGroup this$0;
  
  CommonNavigatorActionGroup$1(CommonNavigatorActionGroup paramCommonNavigatorActionGroup)
  {
    this$0 = paramCommonNavigatorActionGroup;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getProperty().equals("reset"))
    {
      CommonNavigatorActionGroup.access$0(this$0).setEnabled(false);
      CommonNavigatorActionGroup.access$1(this$0).setEnabled(false);
      CommonNavigatorActionGroup.access$2(this$0).setEnabled(false);
    }
    CommonNavigatorActionGroup.access$3(this$0).updateTitle();
    IActionBars actionBars = CommonNavigatorActionGroup.access$3(this$0).getViewSite().getActionBars();
    CommonNavigatorActionGroup.access$4(this$0, actionBars.getToolBarManager());
  }
}

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

import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.commands.ActionHandler;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.handlers.CollapseAllHandler;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.internal.navigator.actions.CollapseAllAction;
import org.eclipse.ui.internal.navigator.actions.LinkEditorAction;
import org.eclipse.ui.internal.navigator.filters.FilterActionGroup;
import org.eclipse.ui.internal.navigator.framelist.BackAction;
import org.eclipse.ui.internal.navigator.framelist.ForwardAction;
import org.eclipse.ui.internal.navigator.framelist.FrameList;
import org.eclipse.ui.internal.navigator.framelist.UpAction;
import org.eclipse.ui.navigator.CommonNavigator;
import org.eclipse.ui.navigator.CommonViewer;
import org.eclipse.ui.navigator.INavigatorContentService;
import org.eclipse.ui.navigator.INavigatorViewerDescriptor;
import org.eclipse.ui.navigator.LinkHelperService;

public class CommonNavigatorActionGroup
  extends ActionGroup
{
  private static final String FRAME_ACTION_SEPARATOR_ID = "FRAME_ACTION_SEPARATOR_ID";
  private static final String FRAME_ACTION_GROUP_ID = "FRAME_ACTION_GROUP_ID";
  private BackAction backAction;
  private ForwardAction forwardAction;
  private UpAction upAction;
  private LinkEditorAction toggleLinkingAction;
  private CollapseAllAction collapseAllAction;
  private FilterActionGroup filterGroup;
  private final CommonViewer commonViewer;
  private CommonNavigator commonNavigator;
  private final LinkHelperService linkHelperService;
  private CollapseAllHandler collapseAllHandler;
  private boolean frameActionsShown;
  
  public CommonNavigatorActionGroup(CommonNavigator aNavigator, CommonViewer aViewer, LinkHelperService linkHelperService)
  {
    commonNavigator = aNavigator;
    commonViewer = aViewer;
    this.linkHelperService = linkHelperService;
    makeActions();
  }
  
  protected final ImageDescriptor getImageDescriptor(String relativePath)
  {
    return NavigatorPlugin.getImageDescriptor("icons/full/" + relativePath);
  }
  
  private void makeActions()
  {
    FrameList frameList = commonViewer.getFrameList();
    backAction = new BackAction(frameList);
    forwardAction = new ForwardAction(frameList);
    upAction = new UpAction(frameList);
    
    frameList.addPropertyChangeListener(new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent event)
      {
        if (event.getProperty().equals("reset"))
        {
          upAction.setEnabled(false);
          backAction.setEnabled(false);
          forwardAction.setEnabled(false);
        }
        commonNavigator.updateTitle();
        IActionBars actionBars = commonNavigator.getViewSite().getActionBars();
        CommonNavigatorActionGroup.this.updateToolBar(actionBars.getToolBarManager());
      }
    });
    IHandlerService service = (IHandlerService)commonNavigator.getSite()
      .getService(IHandlerService.class);
    
    INavigatorViewerDescriptor viewerDescriptor = commonViewer
      .getNavigatorContentService().getViewerDescriptor();
    boolean hideLinkWithEditorAction = viewerDescriptor
      .getBooleanConfigProperty("org.eclipse.ui.navigator.hideLinkWithEditorAction");
    if (!hideLinkWithEditorAction)
    {
      toggleLinkingAction = new LinkEditorAction(commonNavigator, 
        commonViewer, linkHelperService);
      ImageDescriptor syncIcon = getImageDescriptor("elcl16/synced.gif");
      toggleLinkingAction.setImageDescriptor(syncIcon);
      toggleLinkingAction.setHoverImageDescriptor(syncIcon);
      service.activateHandler(toggleLinkingAction.getActionDefinitionId(), 
        new ActionHandler(toggleLinkingAction));
    }
    boolean hideCollapseAllAction = viewerDescriptor
      .getBooleanConfigProperty("org.eclipse.ui.navigator.hideCollapseAllAction");
    if (!hideCollapseAllAction)
    {
      collapseAllAction = new CollapseAllAction(commonViewer);
      ImageDescriptor collapseAllIcon = getImageDescriptor("elcl16/collapseall.gif");
      collapseAllAction.setImageDescriptor(collapseAllIcon);
      collapseAllAction.setHoverImageDescriptor(collapseAllIcon);
      collapseAllHandler = new CollapseAllHandler(commonViewer);
      service.activateHandler("org.eclipse.ui.navigate.collapseAll", collapseAllHandler);
    }
    filterGroup = new FilterActionGroup(commonViewer);
  }
  
  public void fillActionBars(IActionBars actionBars)
  {
    actionBars.setGlobalActionHandler(ActionFactory.BACK.getId(), 
      backAction);
    actionBars.setGlobalActionHandler(ActionFactory.FORWARD.getId(), 
      forwardAction);
    actionBars.setGlobalActionHandler("up", 
      upAction);
    
    filterGroup.fillActionBars(actionBars);
    fillToolBar(actionBars.getToolBarManager());
    fillViewMenu(actionBars.getMenuManager());
    actionBars.updateActionBars();
  }
  
  protected void fillToolBar(IToolBarManager toolBar)
  {
    if ((backAction.isEnabled()) || (upAction.isEnabled()) || (forwardAction.isEnabled()))
    {
      toolBar.add(backAction);
      toolBar.add(forwardAction);
      toolBar.add(upAction);
      toolBar.add(new Separator("FRAME_ACTION_SEPARATOR_ID"));
      frameActionsShown = true;
    }
    toolBar.add(new GroupMarker("FRAME_ACTION_GROUP_ID"));
    if (collapseAllAction != null) {
      toolBar.add(collapseAllAction);
    }
    if (toggleLinkingAction != null) {
      toolBar.add(toggleLinkingAction);
    }
  }
  
  protected void fillViewMenu(IMenuManager menu)
  {
    menu.add(new Separator());
    menu.add(new Separator("additions"));
    menu.add(new Separator("additions-end"));
    if (toggleLinkingAction != null) {
      menu.insertAfter("additions-end", 
        toggleLinkingAction);
    }
  }
  
  private void updateToolBar(IToolBarManager toolBar)
  {
    boolean hasBeenFrameActionsShown = frameActionsShown;
    frameActionsShown = ((backAction.isEnabled()) || (upAction.isEnabled()) || (forwardAction.isEnabled()));
    if (frameActionsShown != hasBeenFrameActionsShown)
    {
      if (hasBeenFrameActionsShown)
      {
        toolBar.remove(backAction.getId());
        toolBar.remove(forwardAction.getId());
        toolBar.remove(upAction.getId());
        toolBar.remove("FRAME_ACTION_SEPARATOR_ID");
      }
      else
      {
        toolBar.prependToGroup("FRAME_ACTION_GROUP_ID", new Separator("FRAME_ACTION_SEPARATOR_ID"));
        toolBar.prependToGroup("FRAME_ACTION_GROUP_ID", upAction);
        toolBar.prependToGroup("FRAME_ACTION_GROUP_ID", forwardAction);
        toolBar.prependToGroup("FRAME_ACTION_GROUP_ID", backAction);
      }
      toolBar.update(true);
    }
  }
  
  public void dispose()
  {
    super.dispose();
    backAction.dispose();
    forwardAction.dispose();
    upAction.dispose();
    if (toggleLinkingAction != null) {
      toggleLinkingAction.dispose();
    }
    if (collapseAllHandler != null) {
      collapseAllHandler.dispose();
    }
  }
}

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

import org.eclipse.ui.internal.navigator.framelist.TreeFrame;
import org.eclipse.ui.internal.navigator.framelist.TreeViewerFrameSource;
import org.eclipse.ui.navigator.CommonNavigator;

public class CommonNavigatorFrameSource
  extends TreeViewerFrameSource
{
  private CommonNavigator navigator;
  
  public CommonNavigatorFrameSource(CommonNavigator navigator)
  {
    super(navigator.getCommonViewer());
    this.navigator = navigator;
  }
  
  protected TreeFrame createFrame(Object input)
  {
    TreeFrame frame = super.createFrame(input);
    frame.setName(navigator.getTitle());
    frame.setToolTipText(navigator.getFrameToolTipText(input));
    return frame;
  }
  
  protected void frameChanged(TreeFrame frame)
  {
    super.frameChanged(frame);
    navigator.updateTitle();
  }
}

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

import org.eclipse.osgi.util.NLS;

public class CommonNavigatorMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.ui.internal.navigator.messages";
  public static String Link_With_Editor_Job_;
  public static String Exception_Invoking_Extension;
  public static String NavigatorViewerDescriptor_Popup_Menu_Overridden;
  public static String StructuredViewerManager_0;
  public static String TextAction_selectAll;
  public static String Cut;
  public static String Copy;
  public static String Paste;
  public static String Delete;
  public static String Navigator_statusLineMultiSelect;
  public static String SelectFiltersActionDelegate_1;
  public static String CommonFilterSelectionDialog_Available_Filters;
  public static String CommonFilterSelectionDialog_Available_Content;
  public static String CommonFilterSelectionDialog_Hides_all_content_associated;
  public static String CommonFilterSelectionDialog_Select_the_available_extensions;
  public static String CommonFilterSelectionDialog_Select_the_filters_to_apply;
  public static String SelectFiltersActionDelegate_0;
  public static String CollapseAllActionDelegate_0;
  public static String LinkEditorActionDelegate_1;
  public static String LinkEditorActionDelegate_0;
  public static String Attribute_Missing_Warning;
  public static String Too_many_elements_Warning;
  public static String Open_action_label;
  public static String NewProjectWizard_errorTitle;
  public static String NewProjectAction_text;
  public static String UpdateFiltersOperation_Update_CommonViewer_Filter_;
  public static String CommonFilterSelectionDialog_enter_name_of_filte_;
  public static String CommonFilterSelectionDialog_Available_customization_;
  public static String CommonSorterDescriptorManager_A_navigatorContent_extesnion_in_0_;
  public static String CommonSorterDescriptorManager_A_navigatorContent_extension_does_n_;
  public static String FilterDialogSelectionListener_Enable_the_0_filter_;
  public static String NavigatorContentServiceLabelProvider_Error_no_label_provider_for_0_;
  public static String CommonViewerSorter_NoContentExtensionForObject;
  public static String NavigatorContentService_problemSavingPreferences;
  
  static
  {
    NLS.initializeMessages("org.eclipse.ui.internal.navigator.messages", CommonNavigatorMessages.class);
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.navigator.ICommonViewerSite;

public class CommonViewerSiteDelegate
  implements ICommonViewerSite
{
  private String id;
  private ISelectionProvider selectionProvider;
  private Shell shell;
  
  public CommonViewerSiteDelegate(String anId, ISelectionProvider aSelectionProvider, Shell aShell)
  {
    Assert.isNotNull(anId);
    Assert.isNotNull(aSelectionProvider);
    Assert.isNotNull(aShell);
    id = anId;
    selectionProvider = aSelectionProvider;
    shell = aShell;
  }
  
  public String getId()
  {
    return id;
  }
  
  public Shell getShell()
  {
    return shell;
  }
  
  public ISelectionProvider getSelectionProvider()
  {
    return selectionProvider;
  }
  
  public void setSelectionProvider(ISelectionProvider aSelectionProvider)
  {
    selectionProvider = aSelectionProvider;
  }
  
  public Object getAdapter(Class adapter)
  {
    return Platform.getAdapterManager().getAdapter(this, adapter);
  }
}

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

import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;

public class CommonViewerSiteIEditorPartSiteDelegate
  implements ICommonViewerWorkbenchSite
{
  private IEditorSite editorSite;
  
  public CommonViewerSiteIEditorPartSiteDelegate(IEditorSite anEditorSite)
  {
    editorSite = anEditorSite;
  }
  
  public String getId()
  {
    return editorSite.getId();
  }
  
  public IActionBars getActionBars()
  {
    return editorSite.getActionBars();
  }
  
  public Object getAdapter(Class adapter)
  {
    return editorSite.getAdapter(adapter);
  }
  
  public IWorkbenchPage getPage()
  {
    return editorSite.getPage();
  }
  
  public ISelectionProvider getSelectionProvider()
  {
    return editorSite.getSelectionProvider();
  }
  
  public void setSelectionProvider(ISelectionProvider aSelectionProvider)
  {
    editorSite.setSelectionProvider(aSelectionProvider);
  }
  
  public Shell getShell()
  {
    return editorSite.getShell();
  }
  
  public IWorkbenchWindow getWorkbenchWindow()
  {
    return editorSite.getWorkbenchWindow();
  }
  
  public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider)
  {
    editorSite.registerContextMenu(menuId, menuManager, selectionProvider);
  }
  
  public IWorkbenchPart getPart()
  {
    return editorSite.getPart();
  }
  
  public IWorkbenchPartSite getSite()
  {
    return editorSite;
  }
}

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

import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.navigator.ICommonViewerSite;
import org.eclipse.ui.part.IPageSite;

public class CommonViewerSiteIPageSiteDelegate
  implements ICommonViewerSite
{
  private IPageSite pageSite;
  private String viewerId;
  
  public CommonViewerSiteIPageSiteDelegate(String aViewerId, IPageSite aPageSite)
  {
    viewerId = aViewerId;
    pageSite = aPageSite;
  }
  
  public String getId()
  {
    return viewerId;
  }
  
  public Object getAdapter(Class adapter)
  {
    return pageSite.getAdapter(adapter);
  }
  
  public ISelectionProvider getSelectionProvider()
  {
    return pageSite.getSelectionProvider();
  }
  
  public void setSelectionProvider(ISelectionProvider aSelectionProvider)
  {
    pageSite.setSelectionProvider(aSelectionProvider);
  }
  
  public Shell getShell()
  {
    return pageSite.getShell();
  }
}

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

import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;

public class CommonViewerSiteIViewSiteDelegate
  implements ICommonViewerWorkbenchSite
{
  private IViewSite viewSite;
  
  public CommonViewerSiteIViewSiteDelegate(IViewSite aViewSite)
  {
    viewSite = aViewSite;
  }
  
  public String getId()
  {
    return viewSite.getId();
  }
  
  public IActionBars getActionBars()
  {
    return viewSite.getActionBars();
  }
  
  public Object getAdapter(Class adapter)
  {
    return viewSite.getAdapter(adapter);
  }
  
  public IWorkbenchPage getPage()
  {
    return viewSite.getPage();
  }
  
  public ISelectionProvider getSelectionProvider()
  {
    return viewSite.getSelectionProvider();
  }
  
  public void setSelectionProvider(ISelectionProvider aSelectionProvider)
  {
    viewSite.setSelectionProvider(aSelectionProvider);
  }
  
  public Shell getShell()
  {
    return viewSite.getShell();
  }
  
  public IWorkbenchWindow getWorkbenchWindow()
  {
    return viewSite.getWorkbenchWindow();
  }
  
  public void registerContextMenu(String menuId, MenuManager menuManager, ISelectionProvider selectionProvider)
  {
    viewSite.registerContextMenu(menuId, menuManager, selectionProvider);
  }
  
  public IWorkbenchPart getPart()
  {
    return viewSite.getPart();
  }
  
  public IWorkbenchPartSite getSite()
  {
    return viewSite;
  }
}

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

import java.util.Iterator;

class ContributorTrackingSet$1
  implements Iterator
{
  Iterator delegateIterator;
  Object current;
  final ContributorTrackingSet this$0;
  
  ContributorTrackingSet$1(ContributorTrackingSet paramContributorTrackingSet)
  {
    this$0 = paramContributorTrackingSet;
    
    delegateIterator = ContributorTrackingSet.access$0(paramContributorTrackingSet);
  }
  
  public boolean hasNext()
  {
    return delegateIterator.hasNext();
  }
  
  public Object next()
  {
    current = delegateIterator.next();
    return current;
  }
  
  public void remove()
  {
    delegateIterator.remove();
    ContributorTrackingSet.access$1(this$0).forgetContribution(current);
  }
}

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

import java.util.Iterator;
import java.util.LinkedHashSet;
import org.eclipse.ui.navigator.INavigatorContentDescriptor;

public class ContributorTrackingSet
  extends LinkedHashSet
{
  private static final long serialVersionUID = 2516241537206281972L;
  private INavigatorContentDescriptor contributor;
  private INavigatorContentDescriptor firstClassContributor;
  private NavigatorContentService contentService;
  
  public ContributorTrackingSet(NavigatorContentService aContentService)
  {
    contentService = aContentService;
  }
  
  public ContributorTrackingSet(NavigatorContentService aContentService, Object[] elements)
  {
    for (int i = 0; i < elements.length; i++) {
      super.add(elements[i]);
    }
    contentService = aContentService;
  }
  
  public boolean add(Object o)
  {
    if (contributor != null) {
      contentService.rememberContribution(contributor, firstClassContributor, o);
    }
    return super.add(o);
  }
  
  public boolean remove(Object o)
  {
    contentService.forgetContribution(o);
    return super.remove(o);
  }
  
  public void clear()
  {
    Iterator it = iterator();
    while (it.hasNext()) {
      contentService.forgetContribution(it.next());
    }
    super.clear();
  }
  
  public INavigatorContentDescriptor getContributor()
  {
    return contributor;
  }
  
  public INavigatorContentDescriptor getFirstClassContributor()
  {
    return firstClassContributor;
  }
  
  public void setContributor(INavigatorContentDescriptor newContributor, INavigatorContentDescriptor theFirstClassContributor)
  {
    contributor = newContributor;
    firstClassContributor = theFirstClassContributor;
  }
  
  public void setContents(Object[] contents)
  {
    super.clear();
    if (contents != null) {
      for (int i = 0; i < contents.length; i++) {
        add(contents[i]);
      }
    }
  }
  
  public Iterator iterator()
  {
    new Iterator()
    {
      Iterator delegateIterator = ContributorTrackingSet.this.iterator();
      Object current;
      
      public boolean hasNext()
      {
        return delegateIterator.hasNext();
      }
      
      public Object next()
      {
        current = delegateIterator.next();
        return current;
      }
      
      public void remove()
      {
        delegateIterator.remove();
        contentService.forgetContribution(current);
      }
    };
  }
}

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

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

class CustomAndExpression$1
  extends NavigatorSafeRunnable
{
  final CustomAndExpression this$0;
  private final IConfigurationElement[] val$children;
  
  CustomAndExpression$1(CustomAndExpression paramCustomAndExpression, IConfigurationElement[] paramArrayOfIConfigurationElement)
  {
    this$0 = paramCustomAndExpression;val$children = paramArrayOfIConfigurationElement;
  }
  
  public void run()
    throws Exception
  {
    this$0.fExpressions = new ArrayList();
    for (int i = 0; i < val$children.length; i++) {
      this$0.fExpressions.add(ElementHandler.getDefault().create(
        ExpressionConverter.getDefault(), val$children[i]));
    }
  }
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.expressions.ElementHandler;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.SafeRunner;

public class CustomAndExpression
  extends Expression
{
  protected List fExpressions;
  
  public CustomAndExpression(IConfigurationElement element)
  {
    Assert.isNotNull(element);
    
    IConfigurationElement[] children = element.getChildren();
    if (children.length == 0) {
      return;
    }
    SafeRunner.run(new NavigatorSafeRunnable()
    {
      private final IConfigurationElement[] val$children;
      
      public void run()
        throws Exception
      {
        fExpressions = new ArrayList();
        for (int i = 0; i < val$children.length; i++) {
          fExpressions.add(ElementHandler.getDefault().create(
            ExpressionConverter.getDefault(), val$children[i]));
        }
      }
    });
  }
  
  public EvaluationResult evaluate(IEvaluationContext scope)
  {
    if (fExpressions == null) {
      return EvaluationResult.TRUE;
    }
    NavigatorPlugin.Evaluator evaluator = new NavigatorPlugin.Evaluator();
    EvaluationResult result = EvaluationResult.TRUE;
    for (Iterator iter = fExpressions.iterator(); iter.hasNext();)
    {
      Expression expression = (Expression)iter.next();
      expression = expression;
      scope = scope;
      SafeRunner.run(evaluator);
      result = result.and(result);
      if (result == EvaluationResult.FALSE) {
        return result;
      }
    }
    return result;
  }
}

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

public abstract interface INavigatorHelpContextIds
{
  public static final String PREFIX = "org.eclipse.ui.";
  public static final String GOTO_RESOURCE_ACTION = "org.eclipse.ui.goto_resource_action_context";
  public static final String TEXT_CUT_ACTION = "org.eclipse.ui.text_cut_action_context";
  public static final String TEXT_COPY_ACTION = "org.eclipse.ui.text_copy_action_context";
  public static final String TEXT_PASTE_ACTION = "org.eclipse.ui.text_paste_action_context";
  public static final String TEXT_DELETE_ACTION = "org.eclipse.ui.text_delete_action_context";
  public static final String TEXT_SELECT_ALL_ACTION = "org.eclipse.ui.text_select_all_action_context";
  public static final String GOTO_RESOURCE_DIALOG = "org.eclipse.ui.goto_resource_dialog_context";
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptor;
import org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptorManager;
import org.eclipse.ui.navigator.IExtensionActivationListener;
import org.eclipse.ui.navigator.INavigatorActivationService;
import org.eclipse.ui.navigator.INavigatorContentDescriptor;
import org.eclipse.ui.navigator.INavigatorContentService;

public final class NavigatorActivationService
  implements INavigatorActivationService
{
  private static final String ACTIVATED_EXTENSIONS = ".activatedExtensions";
  private static final NavigatorContentDescriptorManager CONTENT_DESCRIPTOR_REGISTRY = ;
  private static final INavigatorContentDescriptor[] NO_DESCRIPTORS = new INavigatorContentDescriptor[0];
  private static final String DELIM = ";";
  private static final char EQUALS = '=';
  private final Map activatedExtensionsMap = new HashMap();
  private final ListenerList listeners = new ListenerList();
  private INavigatorContentService contentService;
  
  public NavigatorActivationService(INavigatorContentService aContentService)
  {
    contentService = aContentService;
    revertExtensionActivations();
  }
  
  public boolean isNavigatorExtensionActive(String aNavigatorExtensionId)
  {
    Boolean b = (Boolean)activatedExtensionsMap.get(aNavigatorExtensionId);
    if (b != null) {
      return b.booleanValue();
    }
    synchronized (activatedExtensionsMap)
    {
      NavigatorContentDescriptor descriptor = CONTENT_DESCRIPTOR_REGISTRY.getContentDescriptor(aNavigatorExtensionId);
      if (descriptor == null) {
        return false;
      }
      if (descriptor.isActiveByDefault()) {
        activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.TRUE);
      } else {
        activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.FALSE);
      }
      return descriptor.isActiveByDefault();
    }
  }
  
  public void setActive(String aNavigatorExtensionId, boolean toEnable)
  {
    boolean currentlyActive = isNavigatorExtensionActive(aNavigatorExtensionId);
    if (currentlyActive == toEnable) {
      return;
    }
    if (toEnable) {
      activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.TRUE);
    } else {
      activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.FALSE);
    }
    notifyListeners(new String[] { aNavigatorExtensionId }, toEnable);
  }
  
  public void setActive(String[] aNavigatorExtensionIds, boolean toEnable)
  {
    if (toEnable) {
      for (int i = 0; i < aNavigatorExtensionIds.length; i++) {
        activatedExtensionsMap.put(aNavigatorExtensionIds[i], Boolean.TRUE);
      }
    } else {
      for (int i = 0; i < aNavigatorExtensionIds.length; i++) {
        activatedExtensionsMap.put(aNavigatorExtensionIds[i], Boolean.FALSE);
      }
    }
    notifyListeners(aNavigatorExtensionIds, toEnable);
  }
  
  public void persistExtensionActivations()
  {
    IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot();
    synchronized (activatedExtensionsMap)
    {
      Iterator activatedExtensionsIterator = activatedExtensionsMap.keySet().iterator();
      
      StringBuffer preferenceValue = new StringBuffer();
      String navigatorExtensionId = null;
      boolean isActive = false;
      while (activatedExtensionsIterator.hasNext())
      {
        navigatorExtensionId = (String)activatedExtensionsIterator.next();
        isActive = isNavigatorExtensionActive(navigatorExtensionId);
        preferenceValue.append(navigatorExtensionId)
          .append('=')
          .append(isActive ? Boolean.TRUE : Boolean.FALSE)
          .append(";");
      }
      prefs.put(getPreferenceKey(), preferenceValue.toString());
    }
    NavigatorContentService.flushPreferences(prefs);
  }
  
  public void addExtensionActivationListener(IExtensionActivationListener aListener)
  {
    listeners.add(aListener);
  }
  
  public void removeExtensionActivationListener(IExtensionActivationListener aListener)
  {
    listeners.remove(aListener);
  }
  
  private void notifyListeners(String[] navigatorExtensionIds, boolean toEnable)
  {
    if (navigatorExtensionIds != null)
    {
      if (navigatorExtensionIds.length > 1) {
        Arrays.sort(navigatorExtensionIds);
      }
      Object[] listenerArray = listeners.getListeners();
      for (int i = 0; i < listenerArray.length; i++) {
        ((IExtensionActivationListener)listenerArray[i]).onExtensionActivation(contentService.getViewerId(), 
          navigatorExtensionIds, toEnable);
      }
    }
  }
  
  private void revertExtensionActivations()
  {
    IEclipsePreferences prefs = NavigatorContentService.getPreferencesRoot();
    
    String activatedExtensionsString = prefs
      .get(getPreferenceKey(), null);
    if ((activatedExtensionsString != null) && 
      (activatedExtensionsString.length() > 0))
    {
      String[] contentExtensionIds = activatedExtensionsString
        .split(";");
      
      String id = null;
      String booleanString = null;
      int indx = 0;
      for (int i = 0; i < contentExtensionIds.length; i++) {
        if ((indx = contentExtensionIds[i].indexOf('=')) > -1)
        {
          id = contentExtensionIds[i].substring(0, indx);
          booleanString = contentExtensionIds[i].substring(indx + 1, contentExtensionIds[i].length());
          activatedExtensionsMap.put(id, Boolean.valueOf(booleanString));
        }
        else
        {
          NavigatorContentDescriptor descriptor = CONTENT_DESCRIPTOR_REGISTRY.getContentDescriptor(contentExtensionIds[i]);
          if (descriptor != null) {
            activatedExtensionsMap.put(id, Boolean.valueOf(descriptor.isActiveByDefault()));
          }
        }
      }
    }
    else
    {
      INavigatorContentDescriptor[] contentDescriptors = CONTENT_DESCRIPTOR_REGISTRY
        .getAllContentDescriptors();
      for (int i = 0; i < contentDescriptors.length; i++) {
        if (contentDescriptors[i].isActiveByDefault()) {
          activatedExtensionsMap.put(contentDescriptors[i].getId(), Boolean.TRUE);
        }
      }
    }
  }
  
  private String getPreferenceKey()
  {
    return contentService.getViewerId() + ".activatedExtensions";
  }
  
  public INavigatorContentDescriptor[] activateExtensions(String[] extensionIds, boolean toDeactivateAllOthers)
  {
    Set activatedDescriptors = new HashSet();
    setActive(extensionIds, true);
    for (int extId = 0; extId < extensionIds.length; extId++) {
      activatedDescriptors.add(CONTENT_DESCRIPTOR_REGISTRY
        .getContentDescriptor(extensionIds[extId]));
    }
    if (toDeactivateAllOthers)
    {
      NavigatorContentDescriptor[] descriptors = CONTENT_DESCRIPTOR_REGISTRY
        .getAllContentDescriptors();
      List descriptorList = new ArrayList(Arrays.asList(descriptors));
      for (int descriptorIndx = 0; descriptorIndx < descriptors.length; descriptorIndx++) {
        for (int extId = 0; extId < extensionIds.length; extId++) {
          if (descriptors[descriptorIndx].getId().equals(
            extensionIds[extId])) {
            descriptorList.remove(descriptors[descriptorIndx]);
          }
        }
      }
      String[] deactivatedExtensions = new String[descriptorList.size()];
      for (int i = 0; i < descriptorList.size(); i++)
      {
        INavigatorContentDescriptor descriptor = (INavigatorContentDescriptor)descriptorList
          .get(i);
        deactivatedExtensions[i] = descriptor.getId();
      }
      setActive(deactivatedExtensions, false);
    }
    if (activatedDescriptors.size() == 0) {
      return NO_DESCRIPTORS;
    }
    return (INavigatorContentDescriptor[])activatedDescriptors
      .toArray(new NavigatorContentDescriptor[activatedDescriptors
      .size()]);
  }
  
  public INavigatorContentDescriptor[] deactivateExtensions(String[] extensionIds, boolean toEnableAllOthers)
  {
    Set activatedDescriptors = new HashSet();
    setActive(extensionIds, false);
    if (toEnableAllOthers)
    {
      NavigatorContentDescriptor[] descriptors = CONTENT_DESCRIPTOR_REGISTRY
        .getAllContentDescriptors();
      List descriptorList = new ArrayList(Arrays.asList(descriptors));
      for (int descriptorIndx = 0; descriptorIndx < descriptors.length; descriptorIndx++) {
        for (int extId = 0; extId < extensionIds.length; extId++) {
          if (descriptors[descriptorIndx].getId().equals(
            extensionIds[extId])) {
            descriptorList.remove(descriptors[descriptorIndx]);
          }
        }
      }
      String[] activatedExtensions = new String[descriptorList.size()];
      for (int i = 0; i < descriptorList.size(); i++)
      {
        NavigatorContentDescriptor descriptor = (NavigatorContentDescriptor)descriptorList
          .get(i);
        activatedExtensions[i] = descriptor.getId();
        activatedDescriptors.add(descriptor);
      }
      setActive(activatedExtensions, true);
    }
    if (activatedDescriptors.size() == 0) {
      return NO_DESCRIPTORS;
    }
    return (INavigatorContentDescriptor[])activatedDescriptors
      .toArray(new NavigatorContentDescriptor[activatedDescriptors
      .size()]);
  }
}

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

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.ui.internal.navigator.extensions.NavigatorContentDescriptor;
import org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension;
import org.eclipse.ui.navigator.INavigatorActivationService;

class NavigatorContentService$1
  extends NavigatorSafeRunnable
{
  final NavigatorContentService this$0;
  
  NavigatorContentService$1(NavigatorContentService paramNavigatorContentService)
  {
    this$0 = paramNavigatorContentService;
  }
  
  public void run()
    throws Exception
  {
    for (Iterator iter = NavigatorContentService.access$0(this$0).keySet().iterator(); iter
          .hasNext();)
    {
      NavigatorContentDescriptor key = (NavigatorContentDescriptor)iter.next();
      INavigatorActivationService activation = this$0.getActivationService();
      if (!activation.isNavigatorExtensionActive(key.getId()))
      {
        NavigatorContentExtension extension = (NavigatorContentExtension)NavigatorContentService.access$0(this$0)
          .get(key);
        iter.remove();
        extension.dispose();
      }
    }
  }
}

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

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.internal.navigator.extensions.NavigatorContentExtension;

class NavigatorContentService$2
  extends NavigatorSafeRunnable
{
  final NavigatorContentService this$0;
  private final NavigatorContentExtension val$element;
  private final IMemento val$aMemento;
  
  NavigatorContentService$2(NavigatorContentService paramNavigatorContentService, IConfigurationElement $anonymous0, NavigatorContentExtension paramNavigatorContentExtension, IMemento paramIMemento)
  {
    super($anonymous0);this$0 = paramNavigatorContentService;val$element = paramNavigatorContentExtension;val$aMemento = paramIMemento;
  }
  
  public void run()
    throws Exception
  {
    val$element.restoreState(val$aMemento);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.navigator.NavigatorContentService.2
 * Java Class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

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