org.eclipse.ui.views.properties.tabbed_3.5.200.v20110928-1505

ption exception)
        {
          handleConfigurationError(id, exception);
        }
        addPropertyCategories(configurationElement);
      }
    }
    if ((propertyCategories == null) || (contributorId == null) || 
      (contributorConfigurationElement == null))
    {
      handleConfigurationError(id, null);
      contributorId = null;
    }
  }
  
  private void addPropertyCategories(IConfigurationElement configurationElement)
  {
    IConfigurationElement[] elements = configurationElement
      .getChildren("propertyCategory");
    for (int i = 0; i < elements.length; i++)
    {
      IConfigurationElement element = elements[i];
      propertyCategories.add(element.getAttribute("category"));
    }
  }
  
  private void handleConfigurationError(String id, CoreException exception)
  {
    String message = MessageFormat.format(CONTRIBUTOR_ERROR, 
      new Object[] { id });
    IStatus status = new Status(4, 
      TabbedPropertyViewPlugin.getPlugin().getBundle().getSymbolicName(), 
      4, message, 
      exception);
    TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
  }
  
  protected ISectionDescriptor[] readSectionDescriptors()
  {
    List result = new ArrayList();
    IConfigurationElement[] extensions = getConfigurationElements("propertySections");
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement extension = extensions[i];
      IConfigurationElement[] sections = extension
        .getChildren("propertySection");
      for (int j = 0; j < sections.length; j++)
      {
        IConfigurationElement section = sections[j];
        ISectionDescriptor descriptor = new SectionDescriptor(section, 
          typeMapper);
        result.add(descriptor);
      }
    }
    return (ISectionDescriptor[])result
      .toArray(new ISectionDescriptor[result.size()]);
  }
  
  protected IConfigurationElement[] getConfigurationElements(String extensionPointId)
  {
    if (contributorId == null) {
      return new IConfigurationElement[0];
    }
    IExtensionPoint point = Platform.getExtensionRegistry()
      .getExtensionPoint(
      TabbedPropertyViewPlugin.getPlugin().getBundle()
      .getSymbolicName(), extensionPointId);
    IConfigurationElement[] extensions = point.getConfigurationElements();
    List unordered = new ArrayList(extensions.length);
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement extension = extensions[i];
      if (extension.getName().equals(extensionPointId))
      {
        String contributor = extension.getAttribute("contributorId");
        if (contributorId.equals(contributor)) {
          unordered.add(extension);
        }
      }
    }
    return (IConfigurationElement[])unordered
      .toArray(new IConfigurationElement[unordered.size()]);
  }
  
  private int getIndex(Object[] array, Object target)
  {
    for (int i = 0; i < array.length; i++) {
      if (array[i].equals(target)) {
        return i;
      }
    }
    return -1;
  }
  
  public ITabDescriptor[] getTabDescriptors(IWorkbenchPart part, ISelection selection)
  {
    if ((selection == null) || (selection.isEmpty())) {
      return EMPTY_DESCRIPTOR_ARRAY;
    }
    ITabDescriptor[] allDescriptors = (ITabDescriptor[])null;
    if (tabDescriptorProvider == null) {
      allDescriptors = getAllTabDescriptors();
    } else {
      allDescriptors = tabDescriptorProvider.getTabDescriptors(part, 
        selection);
    }
    ITabDescriptor[] result = filterTabDescriptors(allDescriptors, part, 
      selection);
    return result;
  }
  
  protected ITabDescriptor[] filterTabDescriptors(ITabDescriptor[] descriptors, IWorkbenchPart part, ISelection selection)
  {
    List result = new ArrayList();
    for (int i = 0; i < descriptors.length; i++)
    {
      ITabDescriptor descriptor = adaptDescriptorFor(descriptors[i], 
        part, selection);
      if (!descriptor.getSectionDescriptors().isEmpty()) {
        result.add(descriptor);
      }
    }
    if (result.size() == 0) {
      return EMPTY_DESCRIPTOR_ARRAY;
    }
    return (ITabDescriptor[])result.toArray(
      new ITabDescriptor[result.size()]);
  }
  
  protected ITabDescriptor adaptDescriptorFor(ITabDescriptor target, IWorkbenchPart part, ISelection selection)
  {
    List filteredSectionDescriptors = new ArrayList();
    List descriptors = target.getSectionDescriptors();
    for (Iterator iter = descriptors.iterator(); iter.hasNext();)
    {
      ISectionDescriptor descriptor = (ISectionDescriptor)iter.next();
      if (descriptor.appliesTo(part, selection)) {
        filteredSectionDescriptors.add(descriptor);
      }
    }
    AbstractTabDescriptor result = (AbstractTabDescriptor)((AbstractTabDescriptor)target)
      .clone();
    result.setSectionDescriptors(filteredSectionDescriptors);
    return result;
  }
  
  protected ITabDescriptor[] getAllTabDescriptors()
  {
    if (tabDescriptors == null)
    {
      List temp = readTabDescriptors();
      populateWithSectionDescriptors(temp);
      temp = sortTabDescriptorsByCategory(temp);
      temp = sortTabDescriptorsByAfterTab(temp);
      tabDescriptors = 
        ((TabDescriptor[])temp.toArray(new TabDescriptor[temp.size()]));
    }
    return tabDescriptors;
  }
  
  protected List readTabDescriptors()
  {
    List result = new ArrayList();
    IConfigurationElement[] extensions = getConfigurationElements("propertyTabs");
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement extension = extensions[i];
      IConfigurationElement[] tabs = extension.getChildren("propertyTab");
      for (int j = 0; j < tabs.length; j++)
      {
        IConfigurationElement tab = tabs[j];
        TabDescriptor descriptor = new TabDescriptor(tab);
        if (getIndex(propertyCategories.toArray(), descriptor
          .getCategory()) == -1) {
          handleTabError(tab, descriptor.getCategory() == null ? "" : 
            descriptor.getCategory());
        } else {
          result.add(descriptor);
        }
      }
    }
    return result;
  }
  
  protected void populateWithSectionDescriptors(List aTabDescriptors)
  {
    ISectionDescriptor[] sections = (ISectionDescriptor[])null;
    if (sectionDescriptorProvider != null) {
      sections = sectionDescriptorProvider.getSectionDescriptors();
    } else {
      sections = readSectionDescriptors();
    }
    for (int i = 0; i < sections.length; i++)
    {
      ISectionDescriptor section = sections[i];
      appendToTabDescriptor(section, aTabDescriptors);
    }
  }
  
  protected void appendToTabDescriptor(ISectionDescriptor section, List aTabDescriptors)
  {
    for (Iterator i = aTabDescriptors.iterator(); i.hasNext();)
    {
      TabDescriptor tab = (TabDescriptor)i.next();
      if (tab.append(section)) {
        return;
      }
    }
    String message = MessageFormat.format(NO_TAB_ERROR, new Object[] {
      section.getId(), section.getTargetTab() });
    IStatus status = new Status(4, 
      TabbedPropertyViewPlugin.getPlugin().getBundle().getSymbolicName(), 
      1, message, null);
    TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
  }
  
  protected List sortTabDescriptorsByCategory(List descriptors)
  {
    Collections.sort(descriptors, new Comparator()
    {
      public int compare(Object arg0, Object arg1)
      {
        TabDescriptor one = (TabDescriptor)arg0;
        TabDescriptor two = (TabDescriptor)arg1;
        String categoryOne = one.getCategory();
        String categoryTwo = two.getCategory();
        int categoryOnePosition = TabbedPropertyRegistry.this.getIndex(
          propertyCategories.toArray(), categoryOne);
        int categoryTwoPosition = TabbedPropertyRegistry.this.getIndex(
          propertyCategories.toArray(), categoryTwo);
        return categoryOnePosition - categoryTwoPosition;
      }
    });
    return descriptors;
  }
  
  protected List sortTabDescriptorsByAfterTab(List tabs)
  {
    if ((tabs.size() == 0) || (propertyCategories == null)) {
      return tabs;
    }
    List sorted = new ArrayList();
    int categoryIndex = 0;
    for (int i = 0; i < propertyCategories.size(); i++)
    {
      List categoryList = new ArrayList();
      String category = (String)propertyCategories.get(i);
      int topOfCategory = categoryIndex;
      int endOfCategory = categoryIndex;
      while ((endOfCategory < tabs.size()) && (
        ((TabDescriptor)tabs.get(endOfCategory)).getCategory()
        .equals(category))) {
        endOfCategory++;
      }
      for (int j = topOfCategory; j < endOfCategory; j++)
      {
        TabDescriptor tab = (TabDescriptor)tabs.get(j);
        if (tab.getAfterTab().equals("top")) {
          categoryList.add(0, tabs.get(j));
        } else {
          categoryList.add(tabs.get(j));
        }
      }
      Collections.sort(categoryList, new Comparator()
      {
        public int compare(Object arg0, Object arg1)
        {
          TabDescriptor one = (TabDescriptor)arg0;
          TabDescriptor two = (TabDescriptor)arg1;
          if (two.getAfterTab().equals(one.getId())) {
            return -1;
          }
          if (one.getAfterTab().equals(two.getId())) {
            return 1;
          }
          return 0;
        }
      });
      for (int j = 0; j < categoryList.size(); j++) {
        sorted.add(categoryList.get(j));
      }
      categoryIndex = endOfCategory;
    }
    return sorted;
  }
  
  public ITypeMapper getTypeMapper()
  {
    return typeMapper;
  }
  
  public ILabelProvider getLabelProvider()
  {
    return labelProvider;
  }
  
  public IActionProvider getActionProvider()
  {
    return actionProvider;
  }
  
  public IStructuredContentProvider getTabListContentProvider()
  {
    if (overridableTabListContentProvider) {
      return new OverridableTabListContentProvider(this);
    }
    return new TabListContentProvider(this);
  }
  
  private void handleTabError(IConfigurationElement configurationElement, String category)
  {
    String pluginId = configurationElement.getDeclaringExtension()
      .getNamespaceIdentifier();
    String message = MessageFormat.format(TAB_ERROR, new Object[] {
      pluginId, category });
    IStatus status = new Status(4, pluginId, 
      3, message, null);
    TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
  }
  
  public void dispose()
  {
    if (labelProvider != null)
    {
      labelProvider.dispose();
      labelProvider = null;
    }
    if (tabDescriptors != null) {
      for (int i = 0; i < tabDescriptors.length; i++) {
        if ((tabDescriptors[i] instanceof TabDescriptor)) {
          ((TabDescriptor)tabDescriptors[i]).dispose();
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyRegistry
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import java.util.ArrayList;
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.jface.viewers.IFilter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;
import org.eclipse.ui.views.properties.tabbed.ITypeMapper;

public class TabbedPropertyRegistryClassSectionFilter
{
  private ITypeMapper typeMapper = null;
  
  public TabbedPropertyRegistryClassSectionFilter(ITypeMapper typeMapper)
  {
    this.typeMapper = typeMapper;
  }
  
  public boolean appliesToSelection(ISectionDescriptor descriptor, ISelection selection)
  {
    if (((selection instanceof IStructuredSelection)) && 
      (!selection.isEmpty()))
    {
      if ((descriptor.getEnablesFor() != -1) && 
        (((IStructuredSelection)selection).size() != descriptor
        .getEnablesFor())) {
        return false;
      }
      IFilter filter = descriptor.getFilter();
      if (filter != null)
      {
        for (Iterator i = ((IStructuredSelection)selection).iterator(); i
              .hasNext();)
        {
          Object object = i.next();
          if ((filter != null) && (!filter.select(object))) {
            return false;
          }
        }
        return true;
      }
      Set effectiveTypes = new HashSet();
      for (Iterator i = ((IStructuredSelection)selection).iterator(); i
            .hasNext();)
      {
        Object object = i.next();
        
        Class remapType = object.getClass();
        if (typeMapper != null) {
          remapType = typeMapper.mapType(object);
        }
        if (effectiveTypes.add(remapType)) {
          if (!appliesToEffectiveType(descriptor, remapType)) {
            return false;
          }
        }
      }
    }
    else if (descriptor.getFilter() != null)
    {
      return descriptor.getFilter().select(selection);
    }
    return true;
  }
  
  private boolean appliesToEffectiveType(ISectionDescriptor descriptor, Class inputClass)
  {
    ArrayList classTypes = getClassTypes(inputClass);
    
    List sectionInputTypes = descriptor.getInputTypes();
    for (Iterator j = sectionInputTypes.iterator(); j.hasNext();)
    {
      String type = (String)j.next();
      if (classTypes.contains(type)) {
        return true;
      }
    }
    return false;
  }
  
  protected ArrayList getClassTypes(Class target)
  {
    ArrayList result = new ArrayList();
    
    List classes = computeClassOrder(target);
    for (Iterator i = classes.iterator(); i.hasNext();) {
      result.add(((Class)i.next()).getName());
    }
    result.addAll(computeInterfaceOrder(classes));
    return result;
  }
  
  private List computeClassOrder(Class target)
  {
    List result = new ArrayList(4);
    Class clazz = target;
    while (clazz != null)
    {
      result.add(clazz);
      clazz = clazz.getSuperclass();
    }
    return result;
  }
  
  private List computeInterfaceOrder(List classes)
  {
    List result = new ArrayList(4);
    Map seen = new HashMap(4);
    for (Iterator iter = classes.iterator(); iter.hasNext();)
    {
      Class[] interfaces = ((Class)iter.next()).getInterfaces();
      internalComputeInterfaceOrder(interfaces, result, seen);
    }
    return result;
  }
  
  private void internalComputeInterfaceOrder(Class[] interfaces, List result, Map seen)
  {
    List newInterfaces = new ArrayList(seen.size());
    for (int i = 0; i < interfaces.length; i++)
    {
      Class interfac = interfaces[i];
      if (seen.get(interfac) == null)
      {
        result.add(interfac.getName());
        seen.put(interfac, interfac);
        newInterfaces.add(interfac);
      }
    }
    for (Iterator iter = newInterfaces.iterator(); iter.hasNext();) {
      internalComputeInterfaceOrder(
        ((Class)iter.next()).getInterfaces(), result, seen);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyRegistryClassSectionFilter
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import java.util.List;

class TabbedPropertyRegistryFactory$CacheData
{
  TabbedPropertyRegistry registry;
  List references;
  final TabbedPropertyRegistryFactory this$0;
  
  TabbedPropertyRegistryFactory$CacheData(TabbedPropertyRegistryFactory paramTabbedPropertyRegistryFactory)
  {
    this$0 = paramTabbedPropertyRegistryFactory;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyRegistryFactory.CacheData
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;

public class TabbedPropertyRegistryFactory
{
  private static TabbedPropertyRegistryFactory INSTANCE = new TabbedPropertyRegistryFactory();
  protected Map idToCacheData;
  
  public static TabbedPropertyRegistryFactory getInstance()
  {
    return INSTANCE;
  }
  
  private TabbedPropertyRegistryFactory()
  {
    idToCacheData = new HashMap();
  }
  
  public TabbedPropertyRegistry createRegistry(ITabbedPropertySheetPageContributor target)
  {
    String key = target.getContributorId();
    CacheData data = (CacheData)idToCacheData.get(key);
    if (data == null)
    {
      data = new CacheData();
      registry = new TabbedPropertyRegistry(key);
      references = new ArrayList(5);
      idToCacheData.put(key, data);
    }
    references.add(target);
    
    return registry;
  }
  
  public void disposeRegistry(ITabbedPropertySheetPageContributor target)
  {
    String key = target.getContributorId();
    CacheData data = (CacheData)idToCacheData.get(key);
    if (data != null)
    {
      references.remove(target);
      if (references.isEmpty())
      {
        registry.dispose();
        idToCacheData.remove(key);
      }
    }
  }
  
  class CacheData
  {
    TabbedPropertyRegistry registry;
    List references;
    
    CacheData() {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyRegistryFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Control;

class TabbedPropertyTitle$1
  implements PaintListener
{
  final TabbedPropertyTitle this$0;
  
  TabbedPropertyTitle$1(TabbedPropertyTitle paramTabbedPropertyTitle)
  {
    this$0 = paramTabbedPropertyTitle;
  }
  
  public void paintControl(PaintEvent e)
  {
    if ((TabbedPropertyTitle.access$0(this$0) == null) && ((TabbedPropertyTitle.access$1(this$0) == null) || (TabbedPropertyTitle.access$1(this$0).equals(""))))
    {
      TabbedPropertyTitle.access$2(this$0).setVisible(false);
    }
    else
    {
      TabbedPropertyTitle.access$2(this$0).setVisible(true);
      this$0.drawTitleBackground(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;

public class TabbedPropertyTitle
  extends Composite
{
  private CLabel label;
  private Image image = null;
  private String text = null;
  private static final String BLANK = "";
  private static final String TITLE_FONT = "org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle";
  private TabbedPropertySheetWidgetFactory factory;
  
  public TabbedPropertyTitle(Composite parent, TabbedPropertySheetWidgetFactory factory)
  {
    super(parent, 524288);
    this.factory = factory;
    
    addPaintListener(new PaintListener()
    {
      public void paintControl(PaintEvent e)
      {
        if ((image == null) && ((text == null) || (text.equals(""))))
        {
          label.setVisible(false);
        }
        else
        {
          label.setVisible(true);
          drawTitleBackground(e);
        }
      }
    });
    factory.getColors().initializeSectionToolBarColors();
    setBackground(factory.getColors().getBackground());
    setForeground(factory.getColors().getForeground());
    
    FormLayout layout = new FormLayout();
    marginWidth = 1;
    marginHeight = 2;
    setLayout(layout);
    if (!JFaceResources.getFontRegistry().hasValueFor("org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle"))
    {
      FontData[] fontData = JFaceResources.getFontRegistry().getBold(
        "org.eclipse.jface.defaultfont").getFontData();
      
      fontData[0].setHeight(fontData[0].getHeight() + 2);
      JFaceResources.getFontRegistry().put("org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle", fontData);
    }
    Font font = JFaceResources.getFont("org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle");
    
    label = factory.createCLabel(this, "");
    label.setBackground(new Color[] {
      factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_END"), 
      factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_START") }, 
      new int[] { 100 }, true);
    label.setFont(font);
    label.setForeground(factory.getColors().getColor("org.eclipse.ui.forms.TITLE"));
    FormData data = new FormData();
    left = new FormAttachment(0, 0);
    top = new FormAttachment(0, 0);
    right = new FormAttachment(100, 0);
    bottom = new FormAttachment(100, 0);
    label.setLayoutData(data);
  }
  
  protected void drawTitleBackground(PaintEvent e)
  {
    Rectangle bounds = getClientArea();
    label.setBackground(new Color[] {
      factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_END"), 
      factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_START") }, 
      new int[] { 100 }, true);
    Color bg = factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_END");
    Color gbg = factory.getColors().getColor("org.eclipse.ui.forms.H_GRADIENT_START");
    GC gc = gc;
    gc.setForeground(bg);
    gc.setBackground(gbg);
    gc.fillGradientRectangle(x, y, width, 
      height, true);
    
    gc.setForeground(factory.getColors().getColor(
      "org.eclipse.ui.forms.H_BOTTOM_KEYLINE1"));
    gc.drawLine(x, height - 2, x + width - 1, 
      height - 2);
    gc.setForeground(factory.getColors().getColor(
      "org.eclipse.ui.forms.H_BOTTOM_KEYLINE2"));
    gc.drawLine(x, height - 1, x + width - 1, 
      height - 1);
  }
  
  public void setTitle(String text, Image image)
  {
    this.text = text;
    this.image = image;
    if (text != null) {
      label.setText(text);
    } else {
      label.setText("");
    }
    label.setImage(image);
    redraw();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal.views.properties.tabbed.view;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IWorkbenchPart;

public class TabbedPropertyViewer
  extends StructuredViewer
{
  protected TabbedPropertyList list;
  protected List elements;
  protected IWorkbenchPart part;
  
  public TabbedPropertyViewer(TabbedPropertyList list)
  {
    this.list = list;
    hookControl(list);
    elements = new ArrayList();
  }
  
  public Object getElementAt(int index)
  {
    if ((index >= 0) && (index < elements.size())) {
      return elements.get(index);
    }
    return null;
  }
  
  public int getSelectionIndex()
  {
    return list.getSelectionIndex();
  }
  
  protected Widget doFindInputItem(Object element)
  {
    return null;
  }
  
  protected Widget doFindItem(Object element)
  {
    return null;
  }
  
  protected void doUpdateItem(Widget item, Object element, boolean fullMap) {}
  
  protected List getSelectionFromWidget()
  {
    int index = list.getSelectionIndex();
    if (index == -1) {
      return Collections.EMPTY_LIST;
    }
    List result = new ArrayList(1);
    result.add(getElementAt(index));
    return result;
  }
  
  protected void internalRefresh(Object element) {}
  
  public void reveal(Object element) {}
  
  protected void setSelectionToWidget(List l, boolean reveal)
  {
    if ((l == null) || (l.size() == 0))
    {
      list.deselectAll();
    }
    else
    {
      Object object = l.get(0);
      int index = -1;
      for (int i = 0; i < elements.size(); i++) {
        if (elements.get(i) == object) {
          index = i;
        }
      }
      Assert.isTrue(index != -1, "Could not set the selected tab in the tabbed property viewer");
      list.select(index);
    }
  }
  
  public Control getControl()
  {
    return list;
  }
  
  protected void inputChanged(Object input, Object oldInput)
  {
    elements.clear();
    Object[] children = getSortedChildren(getRoot());
    list.removeAll();
    for (int i = 0; i < children.length; i++)
    {
      elements.add(children[i]);
      mapElement(children[i], list);
    }
    list.setElements(children);
  }
  
  public void setInput(IWorkbenchPart part, ISelection selection)
  {
    this.part = part;
    setInput(selection);
  }
  
  public IWorkbenchPart getWorkbenchPart()
  {
    return part;
  }
  
  public List getElements()
  {
    return elements;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyViewer
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

public class AbstractOverridableTabListPropertySection
  extends AbstractPropertySection
  implements IOverridableTabList
{
  public ITabItem[] getTabs()
  {
    return new ITabItem[0];
  }
  
  public void selectTab(int tab) {}
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AbstractOverridableTabListPropertySection
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;

public abstract class AbstractPropertySection
  implements ISection
{
  public static final int STANDARD_LABEL_WIDTH = 85;
  private TabbedPropertySheetPage tabbedPropertySheetPage;
  private ISelection selection;
  private IWorkbenchPart part;
  
  public TabbedPropertySheetWidgetFactory getWidgetFactory()
  {
    return tabbedPropertySheetPage.getWidgetFactory();
  }
  
  public ISelection getSelection()
  {
    return selection;
  }
  
  public IWorkbenchPart getPart()
  {
    return part;
  }
  
  public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage)
  {
    tabbedPropertySheetPage = aTabbedPropertySheetPage;
  }
  
  public void setInput(IWorkbenchPart part, ISelection selection)
  {
    this.selection = selection;
    this.part = part;
  }
  
  public void aboutToBeShown() {}
  
  public void aboutToBeHidden() {}
  
  public void dispose() {}
  
  public int getMinimumHeight()
  {
    return -1;
  }
  
  public boolean shouldUseExtraSpace()
  {
    return false;
  }
  
  public void refresh() {}
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AbstractPropertySection
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.viewers.IFilter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyRegistryClassSectionFilter;

public abstract class AbstractSectionDescriptor
  implements ISectionDescriptor
{
  private TabbedPropertyRegistryClassSectionFilter classFilter;
  
  public AbstractSectionDescriptor()
  {
    classFilter = new TabbedPropertyRegistryClassSectionFilter(null);
  }
  
  public AbstractSectionDescriptor(ITypeMapper typeMapper)
  {
    classFilter = new TabbedPropertyRegistryClassSectionFilter(typeMapper);
  }
  
  public boolean appliesTo(IWorkbenchPart part, ISelection selection)
  {
    return classFilter.appliesToSelection(this, selection);
  }
  
  public String getAfterSection()
  {
    return "top";
  }
  
  public int getEnablesFor()
  {
    return -1;
  }
  
  public IFilter getFilter()
  {
    return null;
  }
  
  public List getInputTypes()
  {
    return new ArrayList();
  }
  
  public abstract String getTargetTab();
  
  public abstract ISection getSectionClass();
  
  public abstract String getId();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin;
import org.osgi.framework.Bundle;

public abstract class AbstractTabDescriptor
  implements ITabDescriptor, Cloneable
{
  private List sectionDescriptors;
  
  public AbstractTabDescriptor()
  {
    sectionDescriptors = new ArrayList(5);
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException exception)
    {
      IStatus status = new Status(4, 
        TabbedPropertyViewPlugin.getPlugin().getBundle().getSymbolicName(), 666, exception
        .getMessage(), exception);
      TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
    }
    return null;
  }
  
  public TabContents createTab()
  {
    List sections = new ArrayList(getSectionDescriptors().size());
    for (Iterator iter = getSectionDescriptors().iterator(); iter.hasNext();)
    {
      ISectionDescriptor descriptor = (ISectionDescriptor)iter.next();
      ISection section = descriptor.getSectionClass();
      sections.add(section);
    }
    TabContents tab = new TabContents();
    tab.setSections((ISection[])sections.toArray(
      new ISection[sections.size()]));
    return tab;
  }
  
  public boolean equals(Object object)
  {
    if (this == object) {
      return true;
    }
    if (getClass() == object.getClass())
    {
      AbstractTabDescriptor descriptor = (AbstractTabDescriptor)object;
      if ((getCategory().equals(descriptor.getCategory())) && 
        (getId().equals(descriptor.getId())) && 
        (getSectionDescriptors().size() == descriptor
        .getSectionDescriptors().size()))
      {
        Iterator i = getSectionDescriptors().iterator();
        Iterator j = descriptor.getSectionDescriptors().iterator();
        while (i.hasNext())
        {
          ISectionDescriptor source = (ISectionDescriptor)i.next();
          ISectionDescriptor target = (ISectionDescriptor)j.next();
          if (!source.getId().equals(target.getId())) {
            return false;
          }
        }
        return true;
      }
    }
    return false;
  }
  
  public String getAfterTab()
  {
    return "top";
  }
  
  public Image getImage()
  {
    return null;
  }
  
  public List getSectionDescriptors()
  {
    return sectionDescriptors;
  }
  
  public String getText()
  {
    return getLabel();
  }
  
  public int hashCode()
  {
    int hashCode = getCategory().hashCode();
    hashCode ^= getId().hashCode();
    Iterator i = getSectionDescriptors().iterator();
    while (i.hasNext())
    {
      ISectionDescriptor section = (ISectionDescriptor)i.next();
      hashCode ^= section.getId().hashCode();
    }
    return hashCode;
  }
  
  public boolean isIndented()
  {
    return false;
  }
  
  public boolean isSelected()
  {
    return false;
  }
  
  public void setSectionDescriptors(List sectionDescriptors)
  {
    this.sectionDescriptors = sectionDescriptors;
  }
  
  public abstract String getLabel();
  
  public abstract String getId();
  
  public abstract String getCategory();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

public class AbstractTypeMapper
  implements ITypeMapper
{
  public Class mapType(Object object)
  {
    return object.getClass();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AbstractTypeMapper
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;

class AdvancedPropertySection$1
  extends ControlAdapter
{
  final AdvancedPropertySection this$0;
  private final TabbedPropertySheetPage val$atabbedPropertySheetPage;
  
  AdvancedPropertySection$1(AdvancedPropertySection paramAdvancedPropertySection, TabbedPropertySheetPage paramTabbedPropertySheetPage)
  {
    this$0 = paramAdvancedPropertySection;val$atabbedPropertySheetPage = paramTabbedPropertySheetPage;
  }
  
  public void controlResized(ControlEvent e)
  {
    val$atabbedPropertySheetPage.resizeScrolledComposite();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AdvancedPropertySection.1
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.PropertySheetPage;

public class AdvancedPropertySection
  extends AbstractPropertySection
{
  protected PropertySheetPage page;
  
  public void createControls(Composite parent, TabbedPropertySheetPage atabbedPropertySheetPage)
  {
    super.createControls(parent, atabbedPropertySheetPage);
    Composite composite = getWidgetFactory()
      .createFlatFormComposite(parent);
    page = new PropertySheetPage();
    
    page.createControl(composite);
    FormData data = new FormData();
    left = new FormAttachment(0, 0);
    right = new FormAttachment(100, 0);
    top = new FormAttachment(0, 0);
    bottom = new FormAttachment(100, 0);
    page.getControl().setLayoutData(data);
    
    page.getControl().addControlListener(new ControlAdapter()
    {
      private final TabbedPropertySheetPage val$atabbedPropertySheetPage;
      
      public void controlResized(ControlEvent e)
      {
        val$atabbedPropertySheetPage.resizeScrolledComposite();
      }
    });
  }
  
  public void setInput(IWorkbenchPart part, ISelection selection)
  {
    super.setInput(part, selection);
    page.selectionChanged(part, selection);
  }
  
  public void dispose()
  {
    super.dispose();
    if (page != null)
    {
      page.dispose();
      page = null;
    }
  }
  
  public void refresh()
  {
    page.refresh();
  }
  
  public boolean shouldUseExtraSpace()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.AdvancedPropertySection
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.ui.IActionBars;

public abstract interface IActionProvider
{
  public abstract void setActionBars(ITabbedPropertySheetPageContributor paramITabbedPropertySheetPageContributor, IActionBars paramIActionBars);
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.IActionProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

public abstract interface IOverridableTabList
{
  public abstract ITabItem[] getTabs();
  
  public abstract void selectTab(int paramInt);
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.IOverridableTabList
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.jface.viewers.IStructuredContentProvider;

public abstract interface IOverridableTabListContentProvider
  extends IStructuredContentProvider
{
  public abstract void overrideTabs();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.IOverridableTabListContentProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;

public abstract interface ISection
{
  public abstract void createControls(Composite paramComposite, TabbedPropertySheetPage paramTabbedPropertySheetPage);
  
  public abstract void setInput(IWorkbenchPart paramIWorkbenchPart, ISelection paramISelection);
  
  public abstract void aboutToBeShown();
  
  public abstract void aboutToBeHidden();
  
  public abstract void dispose();
  
  public abstract int getMinimumHeight();
  
  public abstract boolean shouldUseExtraSpace();
  
  public abstract void refresh();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.ISection
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import java.util.List;
import org.eclipse.jface.viewers.IFilter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;

public abstract interface ISectionDescriptor
{
  public static final int ENABLES_FOR_ANY = -1;
  public static final String TOP = "top";
  
  public abstract String getId();
  
  public abstract IFilter getFilter();
  
  public abstract List getInputTypes();
  
  public abstract ISection getSectionClass();
  
  public abstract String getTargetTab();
  
  public abstract int getEnablesFor();
  
  public abstract boolean appliesTo(IWorkbenchPart paramIWorkbenchPart, ISelection paramISelection);
  
  public abstract String getAfterSection();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.ISectionDescriptor
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

public abstract interface ISectionDescriptorProvider
{
  public abstract ISectionDescriptor[] getSectionDescriptors();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.ISectionDescriptorProvider
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import java.util.List;

public abstract interface ITabDescriptor
  extends ITabItem
{
  public static final String TOP = "top";
  
  public abstract TabContents createTab();
  
  public abstract String getAfterTab();
  
  public abstract String getCategory();
  
  public abstract String getId();
  
  public abstract String getLabel();
  
  public abstract List getSectionDescriptors();
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.ITabDescriptor
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.views.properties.tabbed;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;

public abstract interface ITabDescriptorProvider
{
  public abstract ITabDescriptor[] getTabDescrip
1 2 3 4 5

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