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

e line #731	-> byte code offset #79
    //   Java source line #733	-> byte code offset #84
    //   Java source line #734	-> byte code offset #89
    //   Java source line #736	-> byte code offset #100
    //   Java source line #737	-> byte code offset #108
    //   Java source line #736	-> byte code offset #113
    //   Java source line #739	-> byte code offset #119
    //   Java source line #740	-> byte code offset #121
    //   Java source line #741	-> byte code offset #126
    //   Java source line #740	-> byte code offset #129
    //   Java source line #742	-> byte code offset #134
    //   Java source line #743	-> byte code offset #138
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	139	0	this	TabbedPropertySheetPage
    //   0	139	1	part	IWorkbenchPart
    //   0	139	2	selection	ISelection
    //   34	8	3	descriptors	ITabDescriptor[]
    //   66	7	4	lastTabSelectionIndex	int
    //   77	32	5	selectedTab	Object
    //   119	8	6	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   84	119	119	finally
  }
  
  public void refresh()
  {
    currentTab.refresh();
  }
  
  public TabContents getCurrentTab()
  {
    return currentTab;
  }
  
  private void handleTabSelection(ITabDescriptor tabDescriptor)
  {
    if (selectionQueueLocked) {
      return;
    }
    for (Iterator i = tabSelectionListeners.iterator(); i.hasNext();)
    {
      ITabSelectionListener listener = (ITabSelectionListener)i.next();
      listener.tabSelected(tabDescriptor);
    }
  }
  
  public void addTabSelectionListener(ITabSelectionListener listener)
  {
    tabSelectionListeners.add(listener);
  }
  
  public void removeTabSelectionListener(ITabSelectionListener listener)
  {
    tabSelectionListeners.remove(listener);
  }
  
  public void overrideTabs()
  {
    if ((tabListContentProvider instanceof IOverridableTabListContentProvider))
    {
      IOverridableTabListContentProvider overridableTabListContentProvider = (IOverridableTabListContentProvider)tabListContentProvider;
      overridableTabListContentProvider.overrideTabs();
    }
  }
  
  public TabbedPropertySheetWidgetFactory getWidgetFactory()
  {
    return widgetFactory;
  }
  
  private void refreshTitleBar()
  {
    if (hasTitleBar)
    {
      TabbedPropertyTitle title = tabbedPropertyComposite.getTitle();
      if (currentTab == null)
      {
        title.setTitle(null, null);
      }
      else
      {
        String text = registry.getLabelProvider().getText(
          currentSelection);
        Image image = registry.getLabelProvider().getImage(
          currentSelection);
        title.setTitle(text, image);
      }
    }
  }
  
  public void labelProviderChanged(LabelProviderChangedEvent event)
  {
    refreshTitleBar();
  }
  
  private ITabbedPropertySheetPageContributor getTabbedPropertySheetPageContributor(Object object)
  {
    if ((object instanceof ITabbedPropertySheetPageContributor)) {
      return (ITabbedPropertySheetPageContributor)object;
    }
    if (((object instanceof IAdaptable)) && 
      (((IAdaptable)object)
      .getAdapter(ITabbedPropertySheetPageContributor.class) != null)) {
      return (ITabbedPropertySheetPageContributor)((IAdaptable)object)
        .getAdapter(ITabbedPropertySheetPageContributor.class);
    }
    if (Platform.getAdapterManager().hasAdapter(object, 
      ITabbedPropertySheetPageContributor.class.getName())) {
      return (ITabbedPropertySheetPageContributor)
        Platform.getAdapterManager().loadAdapter(object, 
        ITabbedPropertySheetPageContributor.class.getName());
    }
    return null;
  }
  
  private void validateRegistry(ISelection selection)
  {
    if (selection == null) {
      return;
    }
    if (!(selection instanceof IStructuredSelection)) {
      return;
    }
    IStructuredSelection structuredSelection = (IStructuredSelection)selection;
    if (structuredSelection.size() == 0) {
      return;
    }
    ITabbedPropertySheetPageContributor newContributor = getTabbedPropertySheetPageContributor(structuredSelection.getFirstElement());
    if (newContributor == null) {
      newContributor = contributor;
    }
    String selectionContributorId = newContributor.getContributorId();
    if (selectionContributorId.equals(currentContributorId)) {
      return;
    }
    Iterator i = structuredSelection.iterator();
    i.next();
    while (i.hasNext())
    {
      newContributor = getTabbedPropertySheetPageContributor(i.next());
      if ((newContributor == null) || (!newContributor.getContributorId().equals(selectionContributorId)))
      {
        if (selectionContributor != null)
        {
          disposeContributor();
          currentContributorId = contributor.getContributorId();
          initContributor(currentContributorId);
        }
        return;
      }
    }
    disposeContributor();
    currentContributorId = selectionContributorId;
    initContributor(currentContributorId);
    overrideActionBars();
  }
  
  private void overrideActionBars()
  {
    if (registry.getActionProvider() != null)
    {
      IActionProvider actionProvider = registry.getActionProvider();
      actionProvider.setActionBars(contributor, getSite().getActionBars());
    }
  }
  
  public ITabDescriptor getSelectedTab()
  {
    int selectedTab = tabbedPropertyViewer.getSelectionIndex();
    if (selectedTab != -1)
    {
      Object object = tabbedPropertyViewer.getElementAt(selectedTab);
      if ((object instanceof ITabDescriptor)) {
        return (ITabDescriptor)object;
      }
    }
    return null;
  }
  
  public ITabDescriptor[] getActiveTabs()
  {
    List elements = tabbedPropertyViewer.getElements();
    if ((elements != null) && (elements.size() > 0))
    {
      ITabDescriptor[] tabDescriptors = (ITabDescriptor[])elements
        .toArray(new ITabDescriptor[0]);
      return tabDescriptors;
    }
    return new ITabDescriptor[0];
  }
  
  public void setSelectedTab(String id)
  {
    List elements = tabbedPropertyViewer.getElements();
    if ((elements != null) && (elements.size() > 0)) {
      for (Iterator i = elements.iterator(); i.hasNext();)
      {
        ITabDescriptor tabDescriptor = (ITabDescriptor)i.next();
        if ((tabDescriptor.getId() != null) && 
          (tabDescriptor.getId().equals(id))) {
          tabbedPropertyViewer.setSelection(new StructuredSelection(
            tabDescriptor), true);
        }
      }
    }
  }
  
  public String getTitleText(ISelection selection)
  {
    if (selection == null) {
      selection = currentSelection;
    }
    return registry.getLabelProvider().getText(selection);
  }
  
  public Image getTitleImage(ISelection selection)
  {
    if (selection == null) {
      selection = currentSelection;
    }
    return registry.getLabelProvider().getImage(selection);
  }
}

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

import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class TabbedPropertySheetWidgetFactory
  extends FormToolkit
{
  public TabbedPropertySheetWidgetFactory()
  {
    super(Display.getCurrent());
  }
  
  public CTabFolder createTabFolder(Composite parent, int style)
  {
    CTabFolder tabFolder = new CTabFolder(parent, style);
    return tabFolder;
  }
  
  public CTabItem createTabItem(CTabFolder tabFolder, int style)
  {
    CTabItem tabItem = new CTabItem(tabFolder, style);
    return tabItem;
  }
  
  public List createList(Composite parent, int style)
  {
    List list = new List(parent, style);
    return list;
  }
  
  public Composite createComposite(Composite parent, int style)
  {
    Composite c = super.createComposite(parent, style);
    paintBordersFor(c);
    return c;
  }
  
  public Composite createComposite(Composite parent)
  {
    Composite c = createComposite(parent, 0);
    return c;
  }
  
  public Composite createPlainComposite(Composite parent, int style)
  {
    Composite c = super.createComposite(parent, style);
    c.setBackground(parent.getBackground());
    paintBordersFor(c);
    return c;
  }
  
  public ScrolledComposite createScrolledComposite(Composite parent, int style)
  {
    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, 
      style);
    return scrolledComposite;
  }
  
  public CCombo createCCombo(Composite parent, int comboStyle)
  {
    CCombo combo = new CCombo(parent, comboStyle);
    adapt(combo, true, false);
    if (getBorderStyle() == 2048) {
      combo.setData("FormWidgetFactory.drawBorder", "textBorder");
    }
    return combo;
  }
  
  public CCombo createCCombo(Composite parent)
  {
    return createCCombo(parent, 8388616);
  }
  
  public Group createGroup(Composite parent, String text)
  {
    Group group = new Group(parent, 32);
    group.setText(text);
    group.setBackground(getColors().getBackground());
    group.setForeground(getColors().getForeground());
    return group;
  }
  
  public Composite createFlatFormComposite(Composite parent)
  {
    Composite composite = createComposite(parent);
    FormLayout layout = new FormLayout();
    marginWidth = 7;
    marginHeight = 4;
    spacing = 7;
    composite.setLayout(layout);
    return composite;
  }
  
  public CLabel createCLabel(Composite parent, String text)
  {
    return createCLabel(parent, text, 0);
  }
  
  public CLabel createCLabel(Composite parent, String text, int style)
  {
    CLabel label = new CLabel(parent, style);
    label.setBackground(parent.getBackground());
    label.setText(text);
    return label;
  }
  
  public void dispose()
  {
    if (getColors() != null) {
      super.dispose();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
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