org.eclipse.ui.forms_3.5.101.v20111011-1919

16:48:10.610 INFO  jd.cli.Main - Decompiling org.eclipse.ui.forms_3.5.101.v20111011-1919.jar
package org.eclipse.ui.forms;

public abstract class AbstractFormPart
  implements IFormPart
{
  private IManagedForm managedForm;
  private boolean dirty = false;
  private boolean stale = true;
  
  public void initialize(IManagedForm form)
  {
    managedForm = form;
  }
  
  public IManagedForm getManagedForm()
  {
    return managedForm;
  }
  
  public void dispose() {}
  
  public void commit(boolean onSave)
  {
    dirty = false;
  }
  
  public boolean setFormInput(Object input)
  {
    return false;
  }
  
  public void setFocus() {}
  
  public void refresh()
  {
    stale = false;
    
    dirty = false;
  }
  
  public void markDirty()
  {
    dirty = true;
    managedForm.dirtyStateChanged();
  }
  
  public boolean isDirty()
  {
    return dirty;
  }
  
  public boolean isStale()
  {
    return stale;
  }
  
  public void markStale()
  {
    stale = true;
    managedForm.staleStateChanged();
  }
}

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

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.ScrolledPageBook;

class DetailsPart$1
  implements Runnable
{
  final DetailsPart this$0;
  private final Object val$key;
  private final IDetailsPage val$fpage;
  private final IDetailsPage val$oldPage;
  
  DetailsPart$1(DetailsPart paramDetailsPart, Object paramObject, IDetailsPage paramIDetailsPage1, IDetailsPage paramIDetailsPage2)
  {
    this$0 = paramDetailsPart;val$key = paramObject;val$fpage = paramIDetailsPage1;val$oldPage = paramIDetailsPage2;
  }
  
  public void run()
  {
    if (!DetailsPart.access$0(this$0).hasPage(val$key))
    {
      Composite parent = DetailsPart.access$0(this$0).createPage(val$key);
      val$fpage.createContents(parent);
      parent.setData(val$fpage);
    }
    if ((val$oldPage != null) && (val$oldPage.isDirty())) {
      val$oldPage.commit(false);
    }
    if (val$fpage.isStale()) {
      val$fpage.refresh();
    }
    val$fpage.selectionChanged(DetailsPart.access$1(this$0), DetailsPart.access$2(this$0));
    DetailsPart.access$0(this$0).showPage(val$key);
  }
}

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

class DetailsPart$PageBag
{
  private static int counter;
  private int ticket;
  private IDetailsPage page;
  private boolean fixed;
  
  public DetailsPart$PageBag(IDetailsPage page, boolean fixed)
  {
    this.page = page;
    this.fixed = fixed;
    ticket = (++counter);
  }
  
  public int getTicket()
  {
    return ticket;
  }
  
  public IDetailsPage getPage()
  {
    return page;
  }
  
  public void dispose()
  {
    page.dispose();
    page = null;
  }
  
  public boolean isFixed()
  {
    return fixed;
  }
  
  public static int getCurrentTicket()
  {
    return counter;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.DetailsPart.PageBag
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.forms;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledPageBook;

public final class DetailsPart
  implements IFormPart, IPartSelectionListener
{
  private IManagedForm managedForm;
  private ScrolledPageBook pageBook;
  private IFormPart masterPart;
  private IStructuredSelection currentSelection;
  private Hashtable pages;
  private IDetailsPageProvider pageProvider;
  private int pageLimit = Integer.MAX_VALUE;
  
  private static class PageBag
  {
    private static int counter;
    private int ticket;
    private IDetailsPage page;
    private boolean fixed;
    
    public PageBag(IDetailsPage page, boolean fixed)
    {
      this.page = page;
      this.fixed = fixed;
      ticket = (++counter);
    }
    
    public int getTicket()
    {
      return ticket;
    }
    
    public IDetailsPage getPage()
    {
      return page;
    }
    
    public void dispose()
    {
      page.dispose();
      page = null;
    }
    
    public boolean isFixed()
    {
      return fixed;
    }
    
    public static int getCurrentTicket()
    {
      return counter;
    }
  }
  
  public DetailsPart(IManagedForm mform, ScrolledPageBook pageBook)
  {
    this.pageBook = pageBook;
    pages = new Hashtable();
    initialize(mform);
  }
  
  public DetailsPart(IManagedForm mform, Composite parent, int style)
  {
    this(mform, mform.getToolkit().createPageBook(parent, style | 0x200 | 0x100));
  }
  
  public void registerPage(Object objectClass, IDetailsPage page)
  {
    registerPage(objectClass, page, true);
  }
  
  private void registerPage(Object objectClass, IDetailsPage page, boolean fixed)
  {
    pages.put(objectClass, new PageBag(page, fixed));
    page.initialize(managedForm);
  }
  
  public void setPageProvider(IDetailsPageProvider provider)
  {
    pageProvider = provider;
  }
  
  public void commit(boolean onSave)
  {
    IDetailsPage page = getCurrentPage();
    if (page != null) {
      page.commit(onSave);
    }
  }
  
  public IDetailsPage getCurrentPage()
  {
    Control control = pageBook.getCurrentPage();
    if (control != null)
    {
      Object data = control.getData();
      if ((data instanceof IDetailsPage)) {
        return (IDetailsPage)data;
      }
    }
    return null;
  }
  
  public void dispose()
  {
    for (Enumeration enm = pages.elements(); enm.hasMoreElements();)
    {
      PageBag pageBag = (PageBag)enm.nextElement();
      pageBag.dispose();
    }
  }
  
  public void initialize(IManagedForm form)
  {
    managedForm = form;
  }
  
  public boolean isDirty()
  {
    IDetailsPage page = getCurrentPage();
    if (page != null) {
      return page.isDirty();
    }
    return false;
  }
  
  public boolean isStale()
  {
    IDetailsPage page = getCurrentPage();
    if (page != null) {
      return page.isStale();
    }
    return false;
  }
  
  public void refresh()
  {
    IDetailsPage page = getCurrentPage();
    if (page != null) {
      page.refresh();
    }
  }
  
  public void setFocus()
  {
    IDetailsPage page = getCurrentPage();
    if (page != null) {
      page.setFocus();
    }
  }
  
  public boolean setFormInput(Object input)
  {
    return false;
  }
  
  public void selectionChanged(IFormPart part, ISelection selection)
  {
    masterPart = part;
    if ((selection instanceof IStructuredSelection)) {
      currentSelection = ((IStructuredSelection)selection);
    } else {
      currentSelection = null;
    }
    update();
  }
  
  private void update()
  {
    Object key = null;
    if (currentSelection != null) {
      for (Iterator iter = currentSelection.iterator(); iter.hasNext();)
      {
        Object obj = iter.next();
        if (key == null)
        {
          key = getKey(obj);
        }
        else if (!getKey(obj).equals(key))
        {
          key = null;
          break;
        }
      }
    }
    showPage(key);
  }
  
  private Object getKey(Object object)
  {
    if (pageProvider != null)
    {
      Object key = pageProvider.getPageKey(object);
      if (key != null) {
        return key;
      }
    }
    return object.getClass();
  }
  
  private void showPage(Object key)
  {
    checkLimit();
    IDetailsPage oldPage = getCurrentPage();
    if (key != null)
    {
      PageBag pageBag = (PageBag)pages.get(key);
      IDetailsPage page = pageBag != null ? pageBag.getPage() : null;
      if (page == null) {
        if (pageProvider != null)
        {
          page = pageProvider.getPage(key);
          if (page != null) {
            registerPage(key, page, false);
          }
        }
      }
      if (page != null)
      {
        IDetailsPage fpage = page;
        BusyIndicator.showWhile(pageBook.getDisplay(), new Runnable()
        {
          private final Object val$key;
          private final IDetailsPage val$fpage;
          private final IDetailsPage val$oldPage;
          
          public void run()
          {
            if (!pageBook.hasPage(val$key))
            {
              Composite parent = pageBook.createPage(val$key);
              val$fpage.createContents(parent);
              parent.setData(val$fpage);
            }
            if ((val$oldPage != null) && (val$oldPage.isDirty())) {
              val$oldPage.commit(false);
            }
            if (val$fpage.isStale()) {
              val$fpage.refresh();
            }
            val$fpage.selectionChanged(masterPart, currentSelection);
            pageBook.showPage(val$key);
          }
        });
        return;
      }
    }
    if ((oldPage != null) && (oldPage.isDirty())) {
      oldPage.commit(false);
    }
    pageBook.showEmptyPage();
  }
  
  private void checkLimit()
  {
    if (pages.size() <= getPageLimit()) {
      return;
    }
    int currentTicket = PageBag.getCurrentTicket();
    int cutoffTicket = currentTicket - getPageLimit();
    for (Enumeration enm = pages.keys(); enm.hasMoreElements();)
    {
      Object key = enm.nextElement();
      PageBag pageBag = (PageBag)pages.get(key);
      if (pageBag.getTicket() <= cutoffTicket) {
        if ((!pageBag.isFixed()) && (!pageBag.getPage().equals(getCurrentPage())))
        {
          pageBag.dispose();
          pages.remove(key);
          pageBook.removePage(key, false);
        }
      }
    }
  }
  
  public int getPageLimit()
  {
    return pageLimit;
  }
  
  public void setPageLimit(int pageLimit)
  {
    this.pageLimit = pageLimit;
    checkLimit();
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;

public class FormColors
{
  /**
   * @deprecated
   */
  public static final String TITLE = "org.eclipse.ui.forms.TITLE";
  /**
   * @deprecated
   */
  public static final String BORDER = "org.eclipse.ui.forms.BORDER";
  /**
   * @deprecated
   */
  public static final String SEPARATOR = "org.eclipse.ui.forms.SEPARATOR";
  /**
   * @deprecated
   */
  public static final String TB_BG = "org.eclipse.ui.forms.TB_BG";
  /**
   * @deprecated
   */
  public static final String TB_FG = "org.eclipse.ui.forms.TB_FG";
  /**
   * @deprecated
   */
  public static final String TB_GBG = "org.eclipse.ui.forms.TB_BG";
  /**
   * @deprecated
   */
  public static final String TB_BORDER = "org.eclipse.ui.forms.TB_BORDER";
  /**
   * @deprecated
   */
  public static final String TB_TOGGLE = "org.eclipse.ui.forms.TB_TOGGLE";
  /**
   * @deprecated
   */
  public static final String TB_TOGGLE_HOVER = "org.eclipse.ui.forms.TB_TOGGLE_HOVER";
  protected Map colorRegistry = new HashMap(10);
  private LocalResourceManager resources;
  protected Color background;
  protected Color foreground;
  private boolean shared;
  protected Display display;
  protected Color border;
  
  public FormColors(Display display)
  {
    this.display = display;
    initialize();
  }
  
  public Display getDisplay()
  {
    return display;
  }
  
  protected void initialize()
  {
    background = display.getSystemColor(25);
    foreground = display.getSystemColor(24);
    initializeColorTable();
    updateBorderColor();
  }
  
  protected void initializeColorTable()
  {
    createTitleColor();
    createColor("org.eclipse.ui.forms.SEPARATOR", getColor("org.eclipse.ui.forms.TITLE").getRGB());
    RGB black = getSystemColor(2);
    RGB borderRGB = getSystemColor(35);
    createColor("org.eclipse.ui.forms.BORDER", blend(borderRGB, black, 80));
  }
  
  public void initializeSectionToolBarColors()
  {
    if (colorRegistry.containsKey("org.eclipse.ui.forms.TB_BG")) {
      return;
    }
    createTitleBarGradientColors();
    createTitleBarOutlineColors();
    createTwistieColors();
  }
  
  protected void initializeFormHeaderColors()
  {
    if (colorRegistry.containsKey("org.eclipse.ui.forms.H_BOTTOM_KEYLINE2")) {
      return;
    }
    createFormHeaderColors();
  }
  
  public RGB getSystemColor(int code)
  {
    return getDisplay().getSystemColor(code).getRGB();
  }
  
  public Color createColor(String key, RGB rgb)
  {
    Color c = getResourceManager().createColor(rgb);
    Color prevC = (Color)colorRegistry.get(key);
    if ((prevC != null) && (!prevC.isDisposed())) {
      getResourceManager().destroyColor(prevC.getRGB());
    }
    colorRegistry.put(key, c);
    return c;
  }
  
  public Color getInactiveBackground()
  {
    String key = "__ncbg__";
    Color color = getColor(key);
    if (color == null)
    {
      RGB sel = getSystemColor(26);
      
      RGB ncbg = blend(sel, getSystemColor(1), 5);
      color = createColor(key, ncbg);
    }
    return color;
  }
  
  public Color createColor(String key, int r, int g, int b)
  {
    return createColor(key, new RGB(r, g, b));
  }
  
  protected void updateBorderColor()
  {
    if (isWhiteBackground())
    {
      border = getColor("org.eclipse.ui.forms.BORDER");
    }
    else
    {
      border = display.getSystemColor(22);
      Color bg = getImpliedBackground();
      if ((border.getRed() == bg.getRed()) && 
        (border.getGreen() == bg.getGreen()) && 
        (border.getBlue() == bg.getBlue())) {
        border = display.getSystemColor(17);
      }
    }
  }
  
  public void setBackground(Color bg)
  {
    background = bg;
    updateBorderColor();
    updateFormHeaderColors();
  }
  
  public void setForeground(Color fg)
  {
    foreground = fg;
  }
  
  public Color getBackground()
  {
    return background;
  }
  
  public Color getForeground()
  {
    return foreground;
  }
  
  public Color getBorderColor()
  {
    return border;
  }
  
  public boolean isWhiteBackground()
  {
    Color bg = getImpliedBackground();
    
    return (bg.getRed() == 255) && (bg.getGreen() == 255) && (bg.getBlue() == 255);
  }
  
  public Color getColor(String key)
  {
    if (key.startsWith("org.eclipse.ui.forms.TB_")) {
      initializeSectionToolBarColors();
    } else if (key.startsWith("org.eclipse.ui.forms.H_")) {
      initializeFormHeaderColors();
    }
    return (Color)colorRegistry.get(key);
  }
  
  public void dispose()
  {
    if (resources != null) {
      resources.dispose();
    }
    resources = null;
    colorRegistry = null;
  }
  
  public void markShared()
  {
    shared = true;
  }
  
  public boolean isShared()
  {
    return shared;
  }
  
  public static RGB blend(RGB c1, RGB c2, int ratio)
  {
    int r = blend(red, red, ratio);
    int g = blend(green, green, ratio);
    int b = blend(blue, blue, ratio);
    return new RGB(r, g, b);
  }
  
  public static boolean testAnyPrimaryColor(RGB rgb, int from, int to)
  {
    if (testPrimaryColor(red, from, to)) {
      return true;
    }
    if (testPrimaryColor(green, from, to)) {
      return true;
    }
    if (testPrimaryColor(blue, from, to)) {
      return true;
    }
    return false;
  }
  
  public static boolean testTwoPrimaryColors(RGB rgb, int from, int to)
  {
    int total = 0;
    if (testPrimaryColor(red, from, to)) {
      total++;
    }
    if (testPrimaryColor(green, from, to)) {
      total++;
    }
    if (testPrimaryColor(blue, from, to)) {
      total++;
    }
    return total >= 2;
  }
  
  private static int blend(int v1, int v2, int ratio)
  {
    int b = (ratio * v1 + (100 - ratio) * v2) / 100;
    return Math.min(255, b);
  }
  
  private Color getImpliedBackground()
  {
    if (getBackground() != null) {
      return getBackground();
    }
    return getDisplay().getSystemColor(22);
  }
  
  private static boolean testPrimaryColor(int value, int from, int to)
  {
    return (value > from) && (value < to);
  }
  
  private void createTitleColor()
  {
    RGB bg = getImpliedBackground().getRGB();
    RGB listSelection = getSystemColor(26);
    RGB listForeground = getSystemColor(24);
    RGB rgb = listSelection;
    if (testTwoPrimaryColors(listSelection, -1, 121)) {
      rgb = listSelection;
    } else if ((testTwoPrimaryColors(listSelection, 120, 256)) || (
      (red == 0) && (green == 0) && (blue == 0))) {
      rgb = blend(listSelection, listForeground, 50);
    }
    createColor("org.eclipse.ui.forms.TITLE", rgb);
  }
  
  private void createTwistieColors()
  {
    RGB rgb = getColor("org.eclipse.ui.forms.TITLE").getRGB();
    RGB white = getSystemColor(1);
    createColor("org.eclipse.ui.forms.TB_TOGGLE", rgb);
    rgb = blend(rgb, white, 60);
    createColor("org.eclipse.ui.forms.TB_TOGGLE_HOVER", rgb);
  }
  
  private void createTitleBarGradientColors()
  {
    RGB tbBg = getSystemColor(31);
    RGB bg = getImpliedBackground().getRGB();
    if (testTwoPrimaryColors(tbBg, 179, 256)) {
      tbBg = blend(tbBg, bg, 30);
    } else if (testTwoPrimaryColors(tbBg, 120, 180)) {
      tbBg = blend(tbBg, bg, 20);
    } else {
      tbBg = blend(tbBg, bg, 10);
    }
    createColor("org.eclipse.ui.forms.TB_BG", tbBg);
    
    createColor("org.eclipse.ui.forms.TB_BG", tbBg);
  }
  
  private void createTitleBarOutlineColors()
  {
    RGB tbBorder = getSystemColor(31);
    RGB bg = getImpliedBackground().getRGB();
    if (testTwoPrimaryColors(tbBorder, 179, 256)) {
      tbBorder = blend(tbBorder, bg, 70);
    } else if (testTwoPrimaryColors(tbBorder, 120, 180)) {
      tbBorder = blend(tbBorder, bg, 50);
    } else {
      tbBorder = blend(tbBorder, bg, 30);
    }
    createColor("org.eclipse.ui.forms.TB_BORDER", tbBorder);
  }
  
  private void updateFormHeaderColors()
  {
    if (colorRegistry.containsKey("org.eclipse.ui.forms.H_GRADIENT_END"))
    {
      disposeIfFound("org.eclipse.ui.forms.H_GRADIENT_END");
      disposeIfFound("org.eclipse.ui.forms.H_GRADIENT_START");
      disposeIfFound("org.eclipse.ui.forms.H_BOTTOM_KEYLINE1");
      disposeIfFound("org.eclipse.ui.forms.H_BOTTOM_KEYLINE2");
      disposeIfFound("org.eclipse.ui.forms.H_H_HOVER_LIGHT");
      disposeIfFound("org.eclipse.ui.forms.H_H_HOVER_FULL");
      initializeFormHeaderColors();
    }
  }
  
  private void disposeIfFound(String key)
  {
    Color color = getColor(key);
    if (color != null)
    {
      colorRegistry.remove(key);
      color.dispose();
    }
  }
  
  private void createFormHeaderColors()
  {
    createFormHeaderGradientColors();
    createFormHeaderKeylineColors();
    createFormHeaderDNDColors();
  }
  
  private void createFormHeaderGradientColors()
  {
    RGB titleBg = getSystemColor(31);
    Color bgColor = getImpliedBackground();
    RGB bg = bgColor.getRGB();
    RGB top;
    RGB bottom;
    RGB top;
    if (testTwoPrimaryColors(titleBg, 179, 256))
    {
      RGB bottom = blend(titleBg, bg, 30);
      top = bg;
    }
    else
    {
      RGB top;
      if (testTwoPrimaryColors(titleBg, 120, 180))
      {
        RGB bottom = blend(titleBg, bg, 20);
        top = bg;
      }
      else
      {
        bottom = blend(titleBg, bg, 10);
        top = bg;
      }
    }
    createColor("org.eclipse.ui.forms.H_GRADIENT_END", top);
    createColor("org.eclipse.ui.forms.H_GRADIENT_START", bottom);
  }
  
  private void createFormHeaderKeylineColors()
  {
    RGB titleBg = getSystemColor(31);
    Color bgColor = getImpliedBackground();
    RGB bg = bgColor.getRGB();
    
    createColor("org.eclipse.ui.forms.H_BOTTOM_KEYLINE1", new RGB(255, 255, 255));
    RGB keyline2;
    RGB keyline2;
    if (testTwoPrimaryColors(titleBg, 179, 256))
    {
      keyline2 = blend(titleBg, bg, 70);
    }
    else
    {
      RGB keyline2;
      if (testTwoPrimaryColors(titleBg, 120, 180)) {
        keyline2 = blend(titleBg, bg, 50);
      } else {
        keyline2 = blend(titleBg, bg, 30);
      }
    }
    createColor("org.eclipse.ui.forms.H_BOTTOM_KEYLINE2", keyline2);
  }
  
  private void createFormHeaderDNDColors()
  {
    RGB titleBg = getSystemColor(32);
    Color bgColor = getImpliedBackground();
    RGB bg = bgColor.getRGB();
    
    RGB light = blend(titleBg, bg, 40);
    
    RGB full = blend(titleBg, bg, 60);
    
    createColor("org.eclipse.ui.forms.H_H_HOVER_LIGHT", light);
    createColor("org.eclipse.ui.forms.H_H_HOVER_FULL", full);
  }
  
  private LocalResourceManager getResourceManager()
  {
    if (resources == null) {
      resources = new LocalResourceManager(JFaceResources.getResources());
    }
    return resources;
  }
}

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

import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.internal.forms.Messages;

public class FormDialog
  extends TrayDialog
{
  private FormToolkit toolkit;
  
  public FormDialog(Shell shell)
  {
    super(shell);
    setShellStyle(getShellStyle() | 0x10);
  }
  
  public FormDialog(IShellProvider parentShellProvider)
  {
    super(parentShellProvider);
  }
  
  public boolean close()
  {
    boolean rcode = super.close();
    toolkit.dispose();
    return rcode;
  }
  
  protected Control createDialogArea(Composite parent)
  {
    toolkit = new FormToolkit(parent.getDisplay());
    ScrolledForm sform = toolkit.createScrolledForm(parent);
    sform.setLayoutData(new GridData(1808));
    ManagedForm mform = new ManagedForm(toolkit, sform);
    createFormContent(mform);
    applyDialogFont(sform.getBody());
    return sform;
  }
  
  protected Control createButtonBar(Composite parent)
  {
    GridData gd = new GridData(768);
    
    Label sep = new Label(parent, 258);
    sep.setLayoutData(gd);
    Control bar = super.createButtonBar(parent);
    return bar;
  }
  
  protected void createFormContent(IManagedForm mform)
  {
    mform.getForm().setText(Messages.FormDialog_defaultTitle);
  }
}

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

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.Hyperlink;

class HyperlinkGroup$GroupListener
  implements Listener, IHyperlinkListener
{
  private Color previousBackground;
  private Color previousForeground;
  final HyperlinkGroup this$0;
  
  private HyperlinkGroup$GroupListener(HyperlinkGroup paramHyperlinkGroup)
  {
    this$0 = paramHyperlinkGroup;
  }
  
  HyperlinkGroup$GroupListener(HyperlinkGroup paramHyperlinkGroup, GroupListener paramGroupListener)
  {
    this(paramHyperlinkGroup);
  }
  
  public void handleEvent(Event e)
  {
    switch (type)
    {
    case 6: 
      onMouseEnter(e);
      break;
    case 7: 
      onMouseExit(e);
      break;
    case 3: 
      HyperlinkGroup.access$0(this$0, e);
      break;
    case 12: 
      HyperlinkGroup.access$1(this$0, (Hyperlink)widget);
    }
  }
  
  private void onMouseEnter(Event e)
  {
    Hyperlink link = (Hyperlink)widget;
    previousBackground = link.getBackground();
    previousForeground = link.getForeground();
    if (HyperlinkGroup.access$2(this$0)) {
      link.setBackground(this$0.getActiveBackground());
    }
    if (HyperlinkGroup.access$3(this$0)) {
      link.setForeground(this$0.getActiveForeground());
    }
    if (this$0.getHyperlinkUnderlineMode() == 2) {
      link.setUnderlined(true);
    }
    link.setCursor(this$0.getHyperlinkCursor());
  }
  
  private void onMouseExit(Event e)
  {
    Hyperlink link = (Hyperlink)widget;
    if (HyperlinkGroup.access$2(this$0)) {
      link.setBackground(previousBackground);
    }
    if (HyperlinkGroup.access$3(this$0)) {
      link.setForeground(previousForeground);
    }
    if (this$0.getHyperlinkUnderlineMode() == 2) {
      link.setUnderlined(false);
    }
  }
  
  public void linkEntered(HyperlinkEvent e)
  {
    Hyperlink link = (Hyperlink)widget;
    if (HyperlinkGroup.access$4(this$0) != null) {
      linkExited(HyperlinkGroup.access$4(this$0));
    }
    HyperlinkGroup.access$5(this$0, link);
  }
  
  public void linkExited(HyperlinkEvent e)
  {
    linkExited((Hyperlink)widget);
  }
  
  private void linkExited(Hyperlink link)
  {
    link.setCursor(null);
    if (HyperlinkGroup.access$4(this$0) == link) {
      HyperlinkGroup.access$5(this$0, null);
    }
  }
  
  public void linkActivated(HyperlinkEvent e) {}
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.HyperlinkGroup.GroupListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.forms;

import java.util.ArrayList;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.Hyperlink;

public final class HyperlinkGroup
  extends HyperlinkSettings
{
  private ArrayList links = new ArrayList();
  private Hyperlink lastActivated;
  private Hyperlink lastEntered;
  private GroupListener listener;
  private boolean isActiveBackgroundSet;
  private boolean isActiveForegroundSet;
  private boolean isBackgroundSet;
  private boolean isForegroundSet;
  
  private class GroupListener
    implements Listener, IHyperlinkListener
  {
    private Color previousBackground;
    private Color previousForeground;
    
    GroupListener(GroupListener paramGroupListener)
    {
      this();
    }
    
    public void handleEvent(Event e)
    {
      switch (type)
      {
      case 6: 
        onMouseEnter(e);
        break;
      case 7: 
        onMouseExit(e);
        break;
      case 3: 
        HyperlinkGroup.this.onMouseDown(e);
        break;
      case 12: 
        HyperlinkGroup.this.unhook((Hyperlink)widget);
      }
    }
    
    private void onMouseEnter(Event e)
    {
      Hyperlink link = (Hyperlink)widget;
      previousBackground = link.getBackground();
      previousForeground = link.getForeground();
      if (isActiveBackgroundSet) {
        link.setBackground(getActiveBackground());
      }
      if (isActiveForegroundSet) {
        link.setForeground(getActiveForeground());
      }
      if (getHyperlinkUnderlineMode() == 2) {
        link.setUnderlined(true);
      }
      link.setCursor(getHyperlinkCursor());
    }
    
    private void onMouseExit(Event e)
    {
      Hyperlink link = (Hyperlink)widget;
      if (isActiveBackgroundSet) {
        link.setBackground(previousBackground);
      }
      if (isActiveForegroundSet) {
        link.setForeground(previousForeground);
      }
      if (getHyperlinkUnderlineMode() == 2) {
        link.setUnderlined(false);
      }
    }
    
    public void linkEntered(HyperlinkEvent e)
    {
      Hyperlink link = (Hyperlink)widget;
      if (lastEntered != null) {
        linkExited(lastEntered);
      }
      lastEntered = link;
    }
    
    public void linkExited(HyperlinkEvent e)
    {
      linkExited((Hyperlink)widget);
    }
    
    private void linkExited(Hyperlink link)
    {
      link.setCursor(null);
      if (lastEntered == link) {
        lastEntered = null;
      }
    }
    
    private GroupListener() {}
    
    public void linkActivated(HyperlinkEvent e) {}
  }
  
  public HyperlinkGroup(Display display)
  {
    super(display);
    listener = new GroupListener(null);
  }
  
  public Hyperlink getLastActivated()
  {
    return lastActivated;
  }
  
  public void add(Hyperlink link)
  {
    if (isBackgroundSet) {
      link.setBackground(getBackground());
    }
    if (isForegroundSet) {
      link.setForeground(getForeground());
    }
    if (getHyperlinkUnderlineMode() == 3) {
      link.setUnderlined(true);
    }
    hook(link);
  }
  
  public void setActiveBackground(Color newActiveBackground)
  {
    super.setActiveBackground(newActiveBackground);
    isActiveBackgroundSet = true;
  }
  
  public void setActiveForeground(Color newActiveForeground)
  {
    super.setActiveForeground(newActiveForeground);
    isActiveForegroundSet = true;
  }
  
  public void setBackground(Color bg)
  {
    super.setBackground(bg);
    isBackgroundSet = true;
    if (links != null) {
      for (int i = 0; i < links.size(); i++)
      {
        Hyperlink label = (Hyperlink)links.get(i);
        label.setBackground(bg);
      }
    }
  }
  
  public void setForeground(Color fg)
  {
    super.setForeground(fg);
    isForegroundSet = true;
    if (links != null) {
      for (int i = 0; i < links.size(); i++)
      {
        Hyperlink label = (Hyperlink)links.get(i);
        label.setForeground(fg);
      }
    }
  }
  
  public void setHyperlinkUnderlineMode(int mode)
  {
    super.setHyperlinkUnderlineMode(mode);
    if (links != null) {
      for (int i = 0; i < links.size(); i++)
      {
        Hyperlink label = (Hyperlink)links.get(i);
        label.setUnderlined(mode == 3);
      }
    }
  }
  
  private void hook(Hyperlink link)
  {
    link.addListener(3, listener);
    link.addHyperlinkListener(listener);
    link.addListener(12, listener);
    link.addListener(6, listener);
    link.addListener(7, listener);
    links.add(link);
  }
  
  private void unhook(Hyperlink link)
  {
    link.removeListener(3, listener);
    link.removeHyperlinkListener(listener);
    link.removeListener(6, listener);
    link.removeListener(7, listener);
    if (lastActivated == link) {
      lastActivated = null;
    }
    if (lastEntered == link) {
      lastEntered = null;
    }
    links.remove(link);
  }
  
  private void onMouseDown(Event e)
  {
    if (button == 1) {
      return;
    }
    lastActivated = ((Hyperlink)widget);
  }
}

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

import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.internal.forms.widgets.FormsResources;

public class HyperlinkSettings
{
  public static final int UNDERLINE_NEVER = 1;
  public static final int UNDERLINE_HOVER = 2;
  public static final int UNDERLINE_ALWAYS = 3;
  private int hyperlinkUnderlineMode = 3;
  private Color background;
  private Color foreground;
  private Color activeBackground;
  private Color activeForeground;
  
  public HyperlinkSettings(Display display)
  {
    initializeDefaultForegrounds(display);
  }
  
  public void initializeDefaultForegrounds(Display display)
  {
    Color fg = JFaceColors.getHyperlinkText(display);
    Color afg = JFaceColors.getActiveHyperlinkText(display);
    if (fg == null) {
      fg = display.getSystemColor(9);
    }
    setForeground(fg);
    setActiveForeground(afg);
  }
  
  public Color getActiveBackground()
  {
    return activeBackground;
  }
  
  public Color getActiveForeground()
  {
    return activeForeground;
  }
  
  public Color getBackground()
  {
    return background;
  }
  
  public Cursor getBusyCursor()
  {
    return FormsResources.getBusyCursor();
  }
  
  public Cursor getTextCursor()
  {
    return FormsResources.getTextCursor();
  }
  
  public Color getForeground()
  {
    return foreground;
  }
  
  public Cursor getHyperlinkCursor()
  {
    return FormsResources.getHandCursor();
  }
  
  public int getHyperlinkUnderlineMode()
  {
    return hyperlinkUnderlineMode;
  }
  
  public void setActiveBackground(Color newActiveBackground)
  {
    activeBackground = newActiveBackground;
  }
  
  public void setActiveForeground(Color newActiveForeground)
  {
    activeForeground = newActiveForeground;
  }
  
  public void setBackground(Color newBackground)
  {
    background = newBackground;
  }
  
  public void setForeground(Color newForeground)
  {
    foreground = newForeground;
  }
  
  public void setHyperlinkUnderlineMode(int mode)
  {
    hyperlinkUnderlineMode = mode;
  }
}

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

import org.eclipse.swt.widgets.Composite;

public abstract interface IDetailsPage
  extends IFormPart, IPartSelectionListener
{
  public abstract void createContents(Composite paramComposite);
}

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

public abstract interface IDetailsPageProvider
{
  public abstract Object getPageKey(Object paramObject);
  
  public abstract IDetailsPage getPage(Object paramObject);
}

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

public abstract interface IFormColors
{
  public static final String PREFIX = "org.eclipse.ui.forms.";
  public static final String TITLE = "org.eclipse.ui.forms.TITLE";
  public static final String H_PREFIX = "org.eclipse.ui.forms.H_";
  public static final String TB_PREFIX = "org.eclipse.ui.forms.TB_";
  public static final String H_GRADIENT_END = "org.eclipse.ui.forms.H_GRADIENT_END";
  public static final String H_GRADIENT_START = "org.eclipse.ui.forms.H_GRADIENT_START";
  public static final String H_BOTTOM_KEYLINE1 = "org.eclipse.ui.forms.H_BOTTOM_KEYLINE1";
  public static final String H_BOTTOM_KEYLINE2 = "org.eclipse.ui.forms.H_BOTTOM_KEYLINE2";
  public static final String H_HOVER_LIGHT = "org.eclipse.ui.forms.H_H_HOVER_LIGHT";
  public static final String H_HOVER_FULL = "org.eclipse.ui.forms.H_H_HOVER_FULL";
  public static final String BORDER = "org.eclipse.ui.forms.BORDER";
  public static final String SEPARATOR = "org.eclipse.ui.forms.SEPARATOR";
  public static final String TB_BG = "org.eclipse.ui.forms.TB_BG";
  public static final String TB_FG = "org.eclipse.ui.forms.TB_FG";
  /**
   * @deprecated
   */
  public static final String TB_GBG = "org.eclipse.ui.forms.TB_BG";
  public static final String TB_BORDER = "org.eclipse.ui.forms.TB_BORDER";
  public static final String TB_TOGGLE = "org.eclipse.ui.forms.TB_TOGGLE";
  public static final String TB_TOGGLE_HOVER = "org.eclipse.ui.forms.TB_TOGGLE_HOVER";
}

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

public abstract interface IFormPart
{
  public abstract void initialize(IManagedForm paramIManagedForm);
  
  public abstract void dispose();
  
  public abstract boolean isDirty();
  
  public abstract void commit(boolean paramBoolean);
  
  public abstract boolean setFormInput(Object paramObject);
  
  public abstract void setFocus();
  
  public abstract boolean isStale();
  
  public abstract void refresh();
}

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

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;

public abstract interface IManagedForm
{
  public abstract void initialize();
  
  public abstract FormToolkit getToolkit();
  
  public abstract ScrolledForm getForm();
  
  public abstract void reflow(boolean paramBoolean);
  
  public abstract void fireSelectionChanged(IFormPart paramIFormPart, ISelection paramISelection);
  
  public abstract IFormPart[] getParts();
  
  public abstract void addPart(IFormPart paramIFormPart);
  
  public abstract void removePart(IFormPart paramIFormPart);
  
  public abstract boolean setInput(Object paramObject);
  
  public abstract Object getInput();
  
  public abstract boolean isDirty();
  
  public abstract void dirtyStateChanged();
  
  public abstract void commit(boolean paramBoolean);
  
  public abstract boolean isStale();
  
  public abstract void staleStateChanged();
  
  public abstract void refresh();
  
  public abstract void setContainer(Object paramObject);
  
  public abstract Object getContainer();
  
  public abstract IMessageManager getMessageManager();
}

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

import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.widgets.Control;

public abstract interface IMessage
  extends IMessageProvider
{
  public abstract Object getKey();
  
  public abstract Object getData();
  
  public abstract Control getControl();
  
  public abstract String getPrefix();
}

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

import org.eclipse.swt.widgets.Control;

public abstract interface IMessageManager
{
  public abstract void addMessage(Object paramObject1, String paramString, Object paramObject2, int paramInt);
  
  public abstract void addMessage(Object paramObject1, String paramString, Object paramObject2, int paramInt, Control paramControl);
  
  public abstract void removeMessage(Object paramObject);
  
  public abstract void removeMessages();
  
  public abstract void removeMessage(Object paramObject, Control paramControl);
  
  public abstract void removeMessages(Control paramControl);
  
  public abstract void removeAllMessages();
  
  public abstract void update();
  
  public abstract void setAutoUpdate(boolean paramBoolean);
  
  public abstract boolean isAutoUpdate();
  
  public abstract void setMessagePrefixProvider(IMessagePrefixProvider paramIMessagePrefixProvider);
  
  public abstract IMessagePrefixProvider getMessagePrefixProvider();
  
  public abstract void setDecorationPosition(int paramInt);
  
  public abstract int getDecorationPosition();
  
  public abstract String createSummary(IMessage[] paramArrayOfIMessage);
}

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

import org.eclipse.swt.widgets.Control;

public abstract interface IMessagePrefixProvider
{
  public abstract String getPrefix(Control paramControl);
}

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

import org.eclipse.jface.viewers.ISelection;

public abstract interface IPartSelectionListener
{
  public abstract void selectionChanged(IFormPart paramIFormPart, ISelection paramISelection);
}

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

class ManagedForm$1
  implements Runnable
{
  final ManagedForm this$0;
  
  ManagedForm$1(ManagedF
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

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