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

      innerWidth -= marginWidth * 2;
    }
    Point textSize = computeTextSize(innerWidth, hHint);
    int textWidth = x + 2 * marginWidth;
    int textHeight = y + 2 * marginHeight;
    return new Point(textWidth, textHeight);
  }
  
  public String getText()
  {
    return text;
  }
  
  public String getToolTipText()
  {
    checkWidget();
    return appToolTipText;
  }
  
  public void setToolTipText(String string)
  {
    super.setToolTipText(string);
    appToolTipText = super.getToolTipText();
  }
  
  public void setText(String text)
  {
    if (text != null) {
      this.text = text;
    } else {
      this.text = "";
    }
    redraw();
  }
  
  protected void paintHyperlink(GC gc)
  {
    Rectangle carea = getClientArea();
    Rectangle bounds = new Rectangle(marginWidth, marginHeight, width - 
      marginWidth - marginWidth, height - marginHeight - 
      marginHeight);
    paintText(gc, bounds);
  }
  
  /* Error */
  protected void paintText(GC gc, Rectangle bounds)
  {
    // Byte code:
    //   0: aload_1
    //   1: aload_0
    //   2: invokevirtual 266	org/eclipse/ui/forms/widgets/Hyperlink:getFont	()Lorg/eclipse/swt/graphics/Font;
    //   5: invokevirtual 248	org/eclipse/swt/graphics/GC:setFont	(Lorg/eclipse/swt/graphics/Font;)V
    //   8: aload_0
    //   9: invokevirtual 261	org/eclipse/ui/forms/widgets/Hyperlink:isEnabled	()Z
    //   12: ifeq +10 -> 22
    //   15: aload_0
    //   16: invokevirtual 265	org/eclipse/ui/forms/widgets/Hyperlink:getForeground	()Lorg/eclipse/swt/graphics/Color;
    //   19: goto +33 -> 52
    //   22: new 116	org/eclipse/swt/graphics/Color
    //   25: dup
    //   26: aload_1
    //   27: invokevirtual 246	org/eclipse/swt/graphics/GC:getDevice	()Lorg/eclipse/swt/graphics/Device;
    //   30: aload_0
    //   31: invokevirtual 264	org/eclipse/ui/forms/widgets/Hyperlink:getBackground	()Lorg/eclipse/swt/graphics/Color;
    //   34: invokevirtual 239	org/eclipse/swt/graphics/Color:getRGB	()Lorg/eclipse/swt/graphics/RGB;
    //   37: aload_0
    //   38: invokevirtual 265	org/eclipse/ui/forms/widgets/Hyperlink:getForeground	()Lorg/eclipse/swt/graphics/Color;
    //   41: invokevirtual 239	org/eclipse/swt/graphics/Color:getRGB	()Lorg/eclipse/swt/graphics/RGB;
    //   44: bipush 70
    //   46: invokestatic 253	org/eclipse/ui/forms/FormColors:blend	(Lorg/eclipse/swt/graphics/RGB;Lorg/eclipse/swt/graphics/RGB;I)Lorg/eclipse/swt/graphics/RGB;
    //   49: invokespecial 240	org/eclipse/swt/graphics/Color:<init>	(Lorg/eclipse/swt/graphics/Device;Lorg/eclipse/swt/graphics/RGB;)V
    //   52: astore_3
    //   53: aload_1
    //   54: aload_3
    //   55: invokevirtual 245	org/eclipse/swt/graphics/GC:setForeground	(Lorg/eclipse/swt/graphics/Color;)V
    //   58: aload_0
    //   59: invokevirtual 257	org/eclipse/ui/forms/widgets/Hyperlink:getStyle	()I
    //   62: bipush 64
    //   64: iand
    //   65: ifeq +19 -> 84
    //   68: aload_1
    //   69: aload_0
    //   70: getfield 228	org/eclipse/ui/forms/widgets/Hyperlink:text	Ljava/lang/String;
    //   73: aload_2
    //   74: aload_0
    //   75: getfield 226	org/eclipse/ui/forms/widgets/Hyperlink:underlined	Z
    //   78: invokestatic 274	org/eclipse/ui/internal/forms/widgets/FormUtil:paintWrapText	(Lorg/eclipse/swt/graphics/GC;Ljava/lang/String;Lorg/eclipse/swt/graphics/Rectangle;Z)V
    //   81: goto +189 -> 270
    //   84: aload_0
    //   85: iconst_m1
    //   86: iconst_m1
    //   87: invokevirtual 267	org/eclipse/ui/forms/widgets/Hyperlink:computeTextSize	(II)Lorg/eclipse/swt/graphics/Point;
    //   90: astore 4
    //   92: iconst_0
    //   93: istore 5
    //   95: aload_2
    //   96: getfield 221	org/eclipse/swt/graphics/Rectangle:width	I
    //   99: aload 4
    //   101: getfield 218	org/eclipse/swt/graphics/Point:x	I
    //   104: if_icmpge +6 -> 110
    //   107: iconst_1
    //   108: istore 5
    //   110: aload_2
    //   111: getfield 221	org/eclipse/swt/graphics/Rectangle:width	I
    //   114: aload 4
    //   116: getfield 218	org/eclipse/swt/graphics/Point:x	I
    //   119: invokestatic 229	java/lang/Math:min	(II)I
    //   122: istore 6
    //   124: aload 4
    //   126: getfield 219	org/eclipse/swt/graphics/Point:y	I
    //   129: istore 7
    //   131: aload_0
    //   132: invokevirtual 262	org/eclipse/ui/forms/widgets/Hyperlink:getText	()Ljava/lang/String;
    //   135: astore 8
    //   137: iload 5
    //   139: ifeq +36 -> 175
    //   142: aload_0
    //   143: aload_1
    //   144: aload_0
    //   145: invokevirtual 262	org/eclipse/ui/forms/widgets/Hyperlink:getText	()Ljava/lang/String;
    //   148: aload_2
    //   149: getfield 221	org/eclipse/swt/graphics/Rectangle:width	I
    //   152: invokevirtual 270	org/eclipse/ui/forms/widgets/Hyperlink:shortenText	(Lorg/eclipse/swt/graphics/GC;Ljava/lang/String;I)Ljava/lang/String;
    //   155: astore 8
    //   157: aload_0
    //   158: getfield 227	org/eclipse/ui/forms/widgets/Hyperlink:appToolTipText	Ljava/lang/String;
    //   161: ifnonnull +22 -> 183
    //   164: aload_0
    //   165: aload_0
    //   166: invokevirtual 262	org/eclipse/ui/forms/widgets/Hyperlink:getText	()Ljava/lang/String;
    //   169: invokespecial 255	org/eclipse/ui/forms/widgets/AbstractHyperlink:setToolTipText	(Ljava/lang/String;)V
    //   172: goto +11 -> 183
    //   175: aload_0
    //   176: aload_0
    //   177: getfield 227	org/eclipse/ui/forms/widgets/Hyperlink:appToolTipText	Ljava/lang/String;
    //   180: invokespecial 255	org/eclipse/ui/forms/widgets/AbstractHyperlink:setToolTipText	(Ljava/lang/String;)V
    //   183: aload_1
    //   184: aload 8
    //   186: aload_2
    //   187: getfield 222	org/eclipse/swt/graphics/Rectangle:x	I
    //   190: aload_2
    //   191: getfield 223	org/eclipse/swt/graphics/Rectangle:y	I
    //   194: iconst_1
    //   195: invokevirtual 244	org/eclipse/swt/graphics/GC:drawText	(Ljava/lang/String;IIZ)V
    //   198: aload_0
    //   199: getfield 226	org/eclipse/ui/forms/widgets/Hyperlink:underlined	Z
    //   202: ifeq +68 -> 270
    //   205: aload_1
    //   206: invokevirtual 249	org/eclipse/swt/graphics/GC:getFontMetrics	()Lorg/eclipse/swt/graphics/FontMetrics;
    //   209: invokevirtual 241	org/eclipse/swt/graphics/FontMetrics:getDescent	()I
    //   212: istore 9
    //   214: aload_2
    //   215: getfield 223	org/eclipse/swt/graphics/Rectangle:y	I
    //   218: iload 7
    //   220: iadd
    //   221: iload 9
    //   223: isub
    //   224: iconst_1
    //   225: iadd
    //   226: istore 10
    //   228: aload_1
    //   229: aload_2
    //   230: getfield 222	org/eclipse/swt/graphics/Rectangle:x	I
    //   233: iload 10
    //   235: aload_2
    //   236: getfield 222	org/eclipse/swt/graphics/Rectangle:x	I
    //   239: iload 6
    //   241: iadd
    //   242: iload 10
    //   244: invokevirtual 243	org/eclipse/swt/graphics/GC:drawLine	(IIII)V
    //   247: goto +23 -> 270
    //   250: astore 11
    //   252: aload_0
    //   253: invokevirtual 261	org/eclipse/ui/forms/widgets/Hyperlink:isEnabled	()Z
    //   256: ifne +11 -> 267
    //   259: aload_3
    //   260: ifnull +7 -> 267
    //   263: aload_3
    //   264: invokevirtual 238	org/eclipse/swt/graphics/Color:dispose	()V
    //   267: aload 11
    //   269: athrow
    //   270: aload_0
    //   271: invokevirtual 261	org/eclipse/ui/forms/widgets/Hyperlink:isEnabled	()Z
    //   274: ifne +11 -> 285
    //   277: aload_3
    //   278: ifnull +7 -> 285
    //   281: aload_3
    //   282: invokevirtual 238	org/eclipse/swt/graphics/Color:dispose	()V
    //   285: return
    // Line number table:
    //   Java source line #209	-> byte code offset #0
    //   Java source line #210	-> byte code offset #8
    //   Java source line #212	-> byte code offset #53
    //   Java source line #213	-> byte code offset #58
    //   Java source line #214	-> byte code offset #68
    //   Java source line #216	-> byte code offset #84
    //   Java source line #217	-> byte code offset #92
    //   Java source line #218	-> byte code offset #95
    //   Java source line #220	-> byte code offset #107
    //   Java source line #222	-> byte code offset #110
    //   Java source line #223	-> byte code offset #124
    //   Java source line #224	-> byte code offset #131
    //   Java source line #225	-> byte code offset #137
    //   Java source line #226	-> byte code offset #142
    //   Java source line #227	-> byte code offset #157
    //   Java source line #228	-> byte code offset #164
    //   Java source line #232	-> byte code offset #175
    //   Java source line #234	-> byte code offset #183
    //   Java source line #235	-> byte code offset #198
    //   Java source line #236	-> byte code offset #205
    //   Java source line #237	-> byte code offset #214
    //   Java source line #238	-> byte code offset #228
    //   Java source line #241	-> byte code offset #250
    //   Java source line #242	-> byte code offset #252
    //   Java source line #243	-> byte code offset #263
    //   Java source line #244	-> byte code offset #267
    //   Java source line #242	-> byte code offset #270
    //   Java source line #243	-> byte code offset #281
    //   Java source line #245	-> byte code offset #285
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	286	0	this	Hyperlink
    //   0	286	1	gc	GC
    //   0	286	2	bounds	Rectangle
    //   52	230	3	fg	org.eclipse.swt.graphics.Color
    //   90	35	4	totalSize	Point
    //   93	45	5	shortenText	boolean
    //   122	118	6	textWidth	int
    //   129	90	7	textHeight	int
    //   135	50	8	textToDraw	String
    //   212	10	9	descent	int
    //   226	17	10	lineY	int
    //   250	18	11	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   53	250	250	finally
  }
  
  protected String shortenText(GC gc, String t, int width)
  {
    if (t == null) {
      return null;
    }
    int w = textExtent"..."x;
    if (width <= w) {
      return t;
    }
    int l = t.length();
    int max = l / 2;
    int min = 0;
    int mid = (max + min) / 2 - 1;
    if (mid <= 0) {
      return t;
    }
    while ((min < mid) && (mid < max))
    {
      String s1 = t.substring(0, mid);
      String s2 = t.substring(l - mid, l);
      int l1 = textExtentx;
      int l2 = textExtentx;
      if (l1 + w + l2 > width)
      {
        max = mid;
        mid = (max + min) / 2;
      }
      else if (l1 + w + l2 < width)
      {
        min = mid;
        mid = (max + min) / 2;
      }
      else
      {
        min = max;
      }
    }
    if (mid == 0) {
      return t;
    }
    return t.substring(0, mid) + "..." + t.substring(l - mid, l);
  }
  
  protected Point computeTextSize(int wHint, int hHint)
  {
    GC gc = new GC(this);
    gc.setFont(getFont());
    Point extent;
    Point extent;
    if (((getStyle() & 0x40) != 0) && (wHint != -1))
    {
      extent = FormUtil.computeWrapSize(gc, getText(), wHint);
    }
    else
    {
      extent = gc.textExtent(getText());
      if (((getStyle() & 0x40) == 0) && (wHint != -1)) {
        x = wHint;
      }
    }
    gc.dispose();
    return extent;
  }
}

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

import org.eclipse.swt.widgets.Composite;

public abstract interface ILayoutExtension
{
  public abstract int computeMinimumWidth(Composite paramComposite, boolean paramBoolean);
  
  public abstract int computeMaximumWidth(Composite paramComposite, boolean paramBoolean);
}

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

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;

class ImageHyperlink$1
  implements DisposeListener
{
  final ImageHyperlink this$0;
  
  ImageHyperlink$1(ImageHyperlink paramImageHyperlink)
  {
    this$0 = paramImageHyperlink;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    if (ImageHyperlink.access$0(this$0) != null) {
      ImageHyperlink.access$0(this$0).dispose();
    }
  }
}

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

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;

public class ImageHyperlink
  extends Hyperlink
{
  public int textSpacing = 5;
  private Image image;
  private Image hoverImage;
  private Image activeImage;
  private Image disabledImage;
  private int state;
  private static final int HOVER = 2;
  private static final int ACTIVE = 4;
  private int verticalAlignment = 16777216;
  private int horizontalAlignment = 16384;
  
  public ImageHyperlink(Composite parent, int style)
  {
    super(parent, removeAlignment(style));
    extractAlignment(style);
    addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        if (disabledImage != null) {
          disabledImage.dispose();
        }
      }
    });
  }
  
  protected void paintHyperlink(GC gc)
  {
    paintHyperlink(gc, getClientArea());
  }
  
  protected void paintHyperlink(GC gc, Rectangle bounds)
  {
    Image image = null;
    if (!isEnabled())
    {
      image = disabledImage;
    }
    else
    {
      if ((state & 0x4) != 0) {
        image = activeImage;
      } else if ((state & 0x2) != 0) {
        image = hoverImage;
      }
      if (image == null) {
        image = this.image;
      }
    }
    Rectangle ibounds = image != null ? image.getBounds() : new Rectangle(0, 0, 0, 0);
    Point maxsize = computeMaxImageSize();
    int spacing = image != null ? textSpacing : 0;
    int textWidth = width - x - spacing - 
      marginWidth - marginWidth;
    int y = y + marginHeight + y / 2 - height / 2;
    if (horizontalAlignment == 16384)
    {
      int x = x + marginWidth + x / 2 - width / 2;
      int textX = x + marginWidth + x + spacing;
      if (image != null) {
        gc.drawImage(image, x, y);
      }
      if (getText() != null) {
        drawText(gc, bounds, textX, textWidth);
      }
    }
    else if (horizontalAlignment == 131072)
    {
      int x = x + marginWidth;
      if (getText() != null) {
        x += drawText(gc, bounds, x, textWidth);
      }
      x += x / 2 - width / 2 + spacing;
      if (image != null) {
        gc.drawImage(image, x, y);
      }
    }
  }
  
  private int drawText(GC gc, Rectangle clientArea, int textX, int textWidth)
  {
    Point textSize = computeTextSize(textWidth, -1);
    int slotHeight = height - marginHeight - marginHeight;
    
    textWidth = x;
    int textHeight = y;
    int textY;
    int textY;
    if (verticalAlignment == 1024)
    {
      textY = marginHeight + slotHeight - textHeight;
    }
    else
    {
      int textY;
      if (verticalAlignment == 16777216) {
        textY = marginHeight + slotHeight / 2 - textHeight / 2;
      } else {
        textY = marginHeight;
      }
    }
    paintText(gc, new Rectangle(textX, textY, textWidth, textHeight));
    return textWidth;
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    checkWidget();
    Point isize = computeMaxImageSize();
    int spacing = x > 0 ? textSpacing : 0;
    Point textSize = null;
    if (getText() != null)
    {
      int innerWHint = wHint;
      if (wHint != -1) {
        innerWHint = wHint - 2 * marginWidth - x - spacing;
      }
      textSize = super.computeSize(innerWHint, hHint, changed);
    }
    int width = x;
    int height = y;
    if (textSize != null)
    {
      width += spacing;
      width += x;
      height = Math.max(height, y);
    }
    width += 2 * marginWidth;
    height += 2 * marginHeight;
    return new Point(width, height);
  }
  
  protected void handleEnter(Event e)
  {
    state = 2;
    super.handleEnter(e);
  }
  
  protected void handleExit(Event e)
  {
    state = 0;
    super.handleExit(e);
  }
  
  protected void handleActivate(Event e)
  {
    state &= 0x4;
    redraw();
    super.handleActivate(e);
    state &= 0xFFFFFFFB;
    if (!isDisposed()) {
      redraw();
    }
  }
  
  public Image getActiveImage()
  {
    return activeImage;
  }
  
  public void setActiveImage(Image activeImage)
  {
    this.activeImage = activeImage;
  }
  
  public Image getHoverImage()
  {
    return hoverImage;
  }
  
  public void setHoverImage(Image hoverImage)
  {
    this.hoverImage = hoverImage;
  }
  
  public Image getImage()
  {
    return image;
  }
  
  public void setImage(Image image)
  {
    this.image = image;
    if (disabledImage != null) {
      disabledImage.dispose();
    }
    if ((image != null) && (!image.isDisposed())) {
      disabledImage = new Image(image.getDevice(), image, 1);
    }
    if (image == null) {
      disabledImage = null;
    }
  }
  
  private Point computeMaxImageSize()
  {
    int x = 0;
    int y = 0;
    if (image != null)
    {
      x = Math.max(image.getBounds().width, x);
      y = Math.max(image.getBounds().height, y);
    }
    if (hoverImage != null)
    {
      x = Math.max(hoverImage.getBounds().width, x);
      y = Math.max(hoverImage.getBounds().height, y);
    }
    if (activeImage != null)
    {
      x = Math.max(activeImage.getBounds().width, x);
      y = Math.max(activeImage.getBounds().height, y);
    }
    return new Point(x, y);
  }
  
  private static int removeAlignment(int style)
  {
    int resultStyle = style;
    if ((style & 0x1000000) != 0) {
      resultStyle &= 0xFEFFFFFF;
    }
    if ((style & 0x80) != 0) {
      resultStyle &= 0xFF7F;
    }
    if ((style & 0x400) != 0) {
      resultStyle &= 0xFBFF;
    }
    if ((style & 0x4000) != 0) {
      resultStyle &= 0xBFFF;
    }
    if ((style & 0x20000) != 0) {
      resultStyle &= 0xFFFDFFFF;
    }
    return resultStyle;
  }
  
  private void extractAlignment(int style)
  {
    if ((style & 0x1000000) != 0) {
      verticalAlignment = 16777216;
    } else if ((style & 0x80) != 0) {
      verticalAlignment = 128;
    } else if ((style & 0x400) != 0) {
      verticalAlignment = 1024;
    }
    if ((style & 0x4000) != 0) {
      horizontalAlignment = 16384;
    } else if ((style & 0x20000) != 0) {
      horizontalAlignment = 131072;
    }
  }
  
  public void setEnabled(boolean enabled)
  {
    if ((!enabled) && ((disabledImage == null) || (disabledImage.isDisposed())) && (image != null) && (!image.isDisposed())) {
      disabledImage = new Image(image.getDevice(), image, 1);
    }
    super.setEnabled(enabled);
    if ((enabled) && (disabledImage != null))
    {
      disabledImage.dispose();
      disabledImage = null;
    }
  }
}

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

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;

public class LayoutCache
{
  private SizeCache[] caches = new SizeCache[0];
  
  public LayoutCache() {}
  
  public LayoutCache(Control[] controls)
  {
    rebuildCache(controls);
  }
  
  public SizeCache getCache(int idx)
  {
    return caches[idx];
  }
  
  public void setControls(Control[] controls)
  {
    if (controls.length != caches.length)
    {
      rebuildCache(controls);
      return;
    }
    for (int idx = 0; idx < controls.length; idx++) {
      caches[idx].setControl(controls[idx]);
    }
  }
  
  private void rebuildCache(Control[] controls)
  {
    SizeCache[] newCache = new SizeCache[controls.length];
    for (int idx = 0; idx < controls.length; idx++) {
      if (idx < caches.length)
      {
        newCache[idx] = caches[idx];
        newCache[idx].setControl(controls[idx]);
      }
      else
      {
        newCache[idx] = new SizeCache(controls[idx]);
      }
    }
    caches = newCache;
  }
  
  public Point computeSize(int controlIndex, int widthHint, int heightHint)
  {
    return caches[controlIndex].computeSize(widthHint, heightHint);
  }
  
  public void flush(int controlIndex)
  {
    caches[controlIndex].flush();
  }
  
  public void flush()
  {
    for (int idx = 0; idx < caches.length; idx++) {
      caches[idx].flush();
    }
  }
}

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

import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Layout;

class LayoutComposite
  extends Composite
{
  public LayoutComposite(Composite parent, int style)
  {
    super(parent, style);
    setMenu(parent.getMenu());
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    Layout layout = getLayout();
    if ((layout instanceof TableWrapLayout)) {
      return ((TableWrapLayout)layout).computeSize(this, wHint, hHint, 
        changed);
    }
    if ((layout instanceof ColumnLayout)) {
      return ((ColumnLayout)layout).computeSize(this, wHint, hHint, 
        changed);
    }
    return super.computeSize(wHint, hHint, changed);
  }
}

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

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class ScrolledForm$1
  implements DisposeListener
{
  final ScrolledForm this$0;
  
  ScrolledForm$1(ScrolledForm paramScrolledForm)
  {
    this$0 = paramScrolledForm;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    if (!ScrolledForm.access$0(this$0)) {
      this$0.setMenu(null);
    }
  }
}

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

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.forms.IMessage;
import org.eclipse.ui.forms.IMessageManager;

public class ScrolledForm
  extends SharedScrolledComposite
{
  private Form content;
  private boolean customMenu;
  
  public ScrolledForm(Composite parent)
  {
    this(parent, 768);
  }
  
  public ScrolledForm(Composite parent, int style)
  {
    super(parent, style);
    super.setMenu(parent.getMenu());
    content = new Form(this, 0);
    super.setContent(content);
    content.setMenu(getMenu());
    addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        if (!customMenu) {
          setMenu(null);
        }
      }
    });
  }
  
  public void setMenu(Menu menu)
  {
    customMenu = true;
    super.setMenu(menu);
    if (content != null) {
      content.setMenu(menu);
    }
  }
  
  public String getText()
  {
    return content.getText();
  }
  
  public Image getImage()
  {
    return content.getImage();
  }
  
  public void setForeground(Color fg)
  {
    super.setForeground(fg);
    content.setForeground(fg);
  }
  
  public void setBackground(Color bg)
  {
    super.setBackground(bg);
    content.setBackground(bg);
  }
  
  public final void setContent(Control c) {}
  
  public void setText(String text)
  {
    content.setText(text);
    reflow(true);
  }
  
  public void setImage(Image image)
  {
    content.setImage(image);
    reflow(true);
  }
  
  public Image getBackgroundImage()
  {
    return content.getBackgroundImage();
  }
  
  public void setBackgroundImage(Image backgroundImage)
  {
    content.setBackgroundImage(backgroundImage);
  }
  
  public IToolBarManager getToolBarManager()
  {
    return content.getToolBarManager();
  }
  
  public void updateToolBar()
  {
    content.updateToolBar();
  }
  
  public Composite getBody()
  {
    return content.getBody();
  }
  
  public Form getForm()
  {
    return content;
  }
  
  public void setBusy(boolean busy)
  {
    content.setBusy(busy);
    reflow(true);
  }
  
  public void setHeadClient(Control headClient)
  {
    content.setHeadClient(headClient);
    reflow(true);
  }
  
  public void setMessage(String newMessage, int newType, IMessage[] messages)
  {
    content.setMessage(newMessage, newType, messages);
    reflow(true);
  }
  
  public void setMessage(String newMessage, int newType)
  {
    setMessage(newMessage, newType, null);
  }
  
  public String getMessage()
  {
    return content.getMessage();
  }
  
  public int getMessageType()
  {
    return content.getMessageType();
  }
  
  public IMessageManager getMessageManager()
  {
    return content.getMessageManager();
  }
}

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

import java.io.InputStream;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

public class ScrolledFormText
  extends SharedScrolledComposite
{
  private FormText content;
  private String text;
  
  public ScrolledFormText(Composite parent, boolean createFormText)
  {
    this(parent, 768, createFormText);
  }
  
  public ScrolledFormText(Composite parent, int style, boolean createFormText)
  {
    super(parent, style);
    if (createFormText) {
      setFormText(new FormText(this, 0));
    }
  }
  
  public void setFormText(FormText formText)
  {
    content = formText;
    super.setContent(content);
    content.setMenu(getMenu());
    if (text != null) {
      loadText(text);
    }
  }
  
  public void setForeground(Color fg)
  {
    super.setForeground(fg);
    if (content != null) {
      content.setForeground(fg);
    }
  }
  
  public void setBackground(Color bg)
  {
    super.setBackground(bg);
    if (content != null) {
      content.setBackground(bg);
    }
  }
  
  public final void setContent(Control c) {}
  
  public void setText(String text)
  {
    this.text = text;
    loadText(text);
    reflow(true);
  }
  
  public void setContents(InputStream is)
  {
    loadContents(is);
  }
  
  public FormText getFormText()
  {
    return content;
  }
  
  private void loadText(String text)
  {
    if (content != null)
    {
      String markup = text;
      if (!markup.startsWith("<form>")) {
        markup = "<form>" + text + "</form>";
      }
      content.setText(markup, true, false);
    }
  }
  
  private void loadContents(InputStream is)
  {
    if (content != null) {
      content.setContents(is, false);
    }
  }
}

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

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class ScrolledPageBook$1
  implements Listener
{
  final ScrolledPageBook this$0;
  
  ScrolledPageBook$1(ScrolledPageBook paramScrolledPageBook)
  {
    this$0 = paramScrolledPageBook;
  }
  
  public void handleEvent(Event e)
  {
    switch (detail)
    {
    case 2: 
    case 4: 
    case 8: 
    case 16: 
      doit = true;
    }
  }
}

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

import java.util.Hashtable;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.internal.forms.widgets.WrappedPageBook;

public class ScrolledPageBook
  extends SharedScrolledComposite
{
  private WrappedPageBook pageBook;
  private Hashtable pages;
  private Composite emptyPage;
  private Control currentPage;
  
  public ScrolledPageBook(Composite parent)
  {
    this(parent, 768);
  }
  
  public ScrolledPageBook(Composite parent, int style)
  {
    super(parent, style);
    pageBook = new WrappedPageBook(this, 0);
    setContent(pageBook);
    pages = new Hashtable();
    setExpandHorizontal(true);
    setExpandVertical(true);
    addListener(31, new Listener()
    {
      public void handleEvent(Event e)
      {
        switch (detail)
        {
        case 2: 
        case 4: 
        case 8: 
        case 16: 
          doit = true;
        }
      }
    });
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    Rectangle trim = computeTrim(0, 0, 10, 10);
    return new Point(width, height);
  }
  
  public boolean hasPage(Object key)
  {
    return pages.containsKey(key);
  }
  
  public Composite createPage(Object key)
  {
    Composite page = createPage();
    pages.put(key, page);
    return page;
  }
  
  public Composite getContainer()
  {
    return pageBook;
  }
  
  public void registerPage(Object key, Control page)
  {
    pages.put(key, page);
  }
  
  public void removePage(Object key)
  {
    removePage(key, true);
  }
  
  public void removePage(Object key, boolean showEmptyPage)
  {
    Control page = (Control)pages.get(key);
    if (page != null)
    {
      pages.remove(key);
      page.dispose();
      if (showEmptyPage) {
        showEmptyPage();
      }
    }
  }
  
  public void showPage(Object key)
  {
    Control page = (Control)pages.get(key);
    if (page != null)
    {
      pageBook.showPage(page);
      if ((currentPage != null) && (currentPage != page)) {
        if ((page instanceof Composite)) {
          ((Composite)page).layout(false);
        }
      }
      currentPage = page;
    }
    else
    {
      showEmptyPage();
    }
    reflow(true);
  }
  
  public void showEmptyPage()
  {
    if (emptyPage == null)
    {
      emptyPage = createPage();
      emptyPage.setLayout(new GridLayout());
    }
    pageBook.showPage(emptyPage);
    currentPage = emptyPage;
    reflow(true);
  }
  
  public boolean setFocus()
  {
    if (currentPage != null) {
      return currentPage.setFocus();
    }
    return super.setFocus();
  }
  
  public Control getCurrentPage()
  {
    return currentPage;
  }
  
  private Composite createPage()
  {
    Composite page = new LayoutComposite(pageBook, 0);
    page.setBackground(getBackground());
    page.setForeground(getForeground());
    page.setMenu(pageBook.getMenu());
    return page;
  }
}

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

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.internal.forms.widgets.FormImages;

class Section$1
  implements Listener
{
  final Section this$0;
  
  Section$1(Section paramSection)
  {
    this$0 = paramSection;
  }
  
  public void handleEvent(Event e)
  {
    Image image = Section.access$0(this$0);
    if (image != null) {
      FormImages.getInstance().markFinished(image, this$0.getDisplay());
    }
    Section.access$1(this$0, null);
  }
}

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

import java.util.Hashtable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.internal.forms.widgets.FormImages;
import org.eclipse.ui.internal.forms.widgets.FormUtil;

public class Section
  extends ExpandableComposite
{
  public static final int DESCRIPTION = 128;
  private Control descriptionControl;
  private Control separator;
  private Hashtable titleColors;
  private static final String COLOR_BG = "bg";
  private static final String COLOR_GBG = "gbg";
  private static final String COLOR_BORDER = "border";
  
  public Section(Composite parent, int style)
  {
    this(parent, 0, style);
  }
  
  Section(Composite parent, int cstyle, int style)
  {
    super(parent, cstyle | getBackgroundStyle(style), style);
    int rtl = cstyle & 0x4000000;
    if ((style & 0x80) != 0) {
      descriptionControl = new Text(this, 0x48 | rtl);
    }
    if ((style & 0x100) != 0)
    {
      Listener listener = new Listener()
      {
        public void handleEvent(Event e)
        {
          Image image = Section.this.getBackgroundImage();
          if (image != null) {
            FormImages.getInstance().markFinished(image, getDisplay());
          }
          Section.this.setBackgroundImage(null);
        }
      };
      addListener(12, listener);
      addListener(11, listener);
    }
  }
  
  private static int getBackgroundStyle(int estyle)
  {
    return (estyle & 0x100) != 0 ? 262144 : 0;
  }
  
  protected void internalSetExpanded(boolean expanded)
  {
    super.internalSetExpanded(expanded);
    if (((getExpansionStyle() & 0x100) != 0) && 
      (!expanded)) {
      super.setBackgroundImage(null);
    }
    reflow();
  }
  
  protected void reflow()
  {
    Composite c = this;
    while (c != null)
    {
      c.setRedraw(false);
      c = c.getParent();
      if (((c instanceof SharedScrolledComposite)) || ((c instanceof Shell))) {
        break;
      }
    }
    c = this;
    while (c != null)
    {
      c.layout(true);
      c = c.getParent();
      if ((c instanceof SharedScrolledComposite))
      {
        ((SharedScrolledComposite)c).reflow(true);
        break;
      }
    }
    c = this;
    while (c != null)
    {
      c.setRedraw(true);
      c = c.getParent();
      if (((c instanceof SharedScrolledComposite)) || ((c instanceof Shell))) {
        break;
      }
    }
  }
  
  public void setDescription(String description)
  {
    if ((descriptionControl instanceof Text)) {
      ((Text)descriptionControl).setText(description);
    }
  }
  
  public String getDescription()
  {
    if ((descriptionControl instanceof Text)) {
      return ((Text)descriptionControl).getText();
    }
    return null;
  }
  
  public void setSeparatorControl(Control separator)
  {
    Assert.isTrue((separator != null) && (separator.getParent().equals(this)));
    this.separator = separator;
  }
  
  public Control getSeparatorControl()
  {
    return separator;
  }
  
  public void setBackground(Color bg)
  {
    super.setBackground(bg);
    if ((descriptionControl != null) && 
      ((getExpansionStyle() & 0x80) != 0)) {
      descriptionControl.setBackground(bg);
    }
  }
  
  public void setForeground(Color fg)
  {
    super.setForeground(fg);
    if ((descriptionControl != null) && 
      ((getExpansionStyle() & 0x80) != 0)) {
      descriptionControl.setForeground(fg);
    }
  }
  
  public Control getDescriptionControl()
  {
    return descriptionControl;
  }
  
  public void setDescriptionControl(Control descriptionControl)
  {
    Assert.isTrue((getExpansionStyle() & 0x80) == 0);
    Assert.isTrue((descriptionControl != null) && 
      (descriptionControl.getParent().equals(this)));
    this.descriptionControl = descriptionControl;
  }
  
  public void setTitleBarBorderColor(Color color)
  {
    putTitleBarColor("border", color);
  }
  
  public void setTitleBarBackground(Color color)
  {
    putTitleBarColor("bg", color);
  }
  
  public void setTitleBarGradientBackground(Color color)
  {
    putTitleBarColor("gbg", color);
  }
  
  public Color getTitleBarBorderColor()
  {
    if (titleColors == null) {
      return null;
    }
    return (Color)titleColors.get("border");
  }
  
  public Color getTitleBarGradientBackground()
  {
    if (titleColors == null) {
      return null;
    }
    if ((getExpansionStyle() & 0x200) != 0) {
      return getBackground();
    }
    return (Color)titleColors.get("gbg");
  }
  
  public Color getTitleBarBackground()
  {
    if (titleColors == null) {
      return null;
    }
    return (Color)titleColors.get("bg");
  }
  
  private void putTitleBarColor(String key, Color color)
  {
    if (color == null) {
      return;
    }
    if (titleColors == null) {
      titleColors = new Hashtable();
    }
    titleColors.put(key, color);
  }
  
  protected void onPaint(PaintEvent e)
  {
    Color bg = null;
    Color fg = null;
    Color border = null;
    
    GC gc = gc;
    Image buffer = null;
    Rectangle bounds = getClientArea();
    if ((getExpansionStyle() & 0x100) != 0)
    {
      buffer = new Image(getDisplay(), width, height);
      buffer.setBackground(getBackground());
      gc = new GC(buffer);
    }
    if (titleColors != null)
    {
      bg = (Color)titleColors.get("bg");
      fg = getTitleBarForeground();
      border = (Color)titleColors.get("border");
    }
    if (bg == null) {
      bg = getBackground();
    }
    if (fg == null) {
      fg = getForeground();
    }
    if (border == null) {
      border = fg;
    }
    int theight = 0;
    int gradientheight = 0;
    int tvmargin = 4;
    if ((getExpansionStyle() & 0x100) != 0)
    {
      Point tsize = null;
      Point tcsize = null;
      if (toggle != null) {
        tsize = toggle.getSize();
      }
      if (getTextClient() != null) {
        tcsize = getTextClient().getSize();
      }
      Point size = textLabel == null ? new Point(0, 0) : textLabel.getSize();
      if (tsize != null) {
        theight += Math.max(theight, y);
      }
      gradientheight = theight;
      if (tcsize != null) {
        theight = Math.max(theight, y);
      }
      theight = Math.max(theight, y);
      gradientheight = Math.max(gradientheight, y);
      theight += tvmargin + tvmargin;
      gradientheight += tvmargin + tvmargin;
    }
    else
    {
      theight = 5;
    }
    if ((getExpansionStyle() & 0x100) != 0)
    {
      if (getBackgroundImage() == null) {
        updateHeaderImage(bg, bounds, gradientheight, theight);
      }
      gc.setBackground(getBackground());
      gc.fillRectangle(x, y, width, height);
      drawBackground(gc, x, y, width, theight);
      if (marginWidth > 0)
      {
        gc.setBackground(getBackground());
        gc.fillRectangle(0, 0, marginWidth, theight);
        gc.fillRectangle(x + width - marginWidth, 0, 
          marginWidth, theight);
      }
    }
    else if (isExpanded())
    {
      gc.setForeground(bg);
      gc.setBackground(getBackground());
      gc.fillGradientRectangle(marginWidth, marginHeight, width - 
        marginWidth - marginWidth, theight, true);
    }
    gc.setBackground(getBackground());
    FormUtil.setAntialias(gc, 1);
    
    gc.fillPolygon(new int[] { marginWidth, marginHeight, marginWidth, 
      marginHeight + 2, marginWidth + 2, marginHeight });
    
    gc.fillPolygon(new int[] { width - marginWidth - 3, 
      marginHeight, width - marginWidth, marginHeight, 
      width - marginWidth, marginHeight + 3 });
    gc.setForeground(border);
    if 
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