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

rue;
    }
    return super.isDirty();
  }
  
  protected void commitPages(boolean onSave)
  {
    if ((headerForm != null) && (headerForm.isDirty())) {
      headerForm.commit(onSave);
    }
    super.commitPages(onSave);
  }
  
  protected void createHeaderContents(IManagedForm headerForm) {}
}

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

public class ExpansionAdapter
  implements IExpansionListener
{
  public void expansionStateChanging(ExpansionEvent e) {}
  
  public void expansionStateChanged(ExpansionEvent e) {}
}

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

import org.eclipse.swt.events.TypedEvent;

public final class ExpansionEvent
  extends TypedEvent
{
  private static final long serialVersionUID = 6009335074727417445L;
  
  public ExpansionEvent(Object obj, boolean state)
  {
    super(obj);
    data = (state ? Boolean.TRUE : Boolean.FALSE);
  }
  
  public boolean getState()
  {
    return data.equals(Boolean.TRUE);
  }
}

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

public class HyperlinkAdapter
  implements IHyperlinkListener
{
  public void linkEntered(HyperlinkEvent e) {}
  
  public void linkExited(HyperlinkEvent e) {}
  
  public void linkActivated(HyperlinkEvent e) {}
}

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

import org.eclipse.swt.events.TypedEvent;
import org.eclipse.swt.widgets.Widget;

public final class HyperlinkEvent
  extends TypedEvent
{
  private static final long serialVersionUID = 6009335074727417445L;
  private String label;
  private int stateMask;
  
  public HyperlinkEvent(Widget widget, Object href, String label, int stateMask)
  {
    super(widget);
    this.widget = widget;
    data = href;
    this.label = label;
    this.stateMask = stateMask;
  }
  
  public Object getHref()
  {
    return data;
  }
  
  public String getLabel()
  {
    return label;
  }
  
  public int getStateMask()
  {
    return stateMask;
  }
}

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

public abstract interface IExpansionListener
{
  public abstract void expansionStateChanging(ExpansionEvent paramExpansionEvent);
  
  public abstract void expansionStateChanged(ExpansionEvent paramExpansionEvent);
}

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

public abstract interface IHyperlinkListener
{
  public abstract void linkEntered(HyperlinkEvent paramHyperlinkEvent);
  
  public abstract void linkExited(HyperlinkEvent paramHyperlinkEvent);
  
  public abstract void linkActivated(HyperlinkEvent paramHyperlinkEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.events.IHyperlinkListener
 * 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 AbstractHyperlink$1
  implements Listener
{
  final AbstractHyperlink this$0;
  
  AbstractHyperlink$1(AbstractHyperlink paramAbstractHyperlink)
  {
    this$0 = paramAbstractHyperlink;
  }
  
  public void handleEvent(Event e)
  {
    if (character == '\r') {
      this$0.handleActivate(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.widgets.AbstractHyperlink.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.PaintEvent;
import org.eclipse.swt.events.PaintListener;

class AbstractHyperlink$2
  implements PaintListener
{
  final AbstractHyperlink this$0;
  
  AbstractHyperlink$2(AbstractHyperlink paramAbstractHyperlink)
  {
    this$0 = paramAbstractHyperlink;
  }
  
  public void paintControl(PaintEvent e)
  {
    this$0.paint(e);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.widgets.AbstractHyperlink.2
 * 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 AbstractHyperlink$3
  implements Listener
{
  final AbstractHyperlink this$0;
  
  AbstractHyperlink$3(AbstractHyperlink paramAbstractHyperlink)
  {
    this$0 = paramAbstractHyperlink;
  }
  
  public void handleEvent(Event e)
  {
    switch (detail)
    {
    case 4: 
    case 32: 
    case 64: 
    case 256: 
    case 512: 
      doit = false;
      return;
    }
    doit = true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.widgets.AbstractHyperlink.3
 * 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 AbstractHyperlink$4
  implements Listener
{
  final AbstractHyperlink this$0;
  
  AbstractHyperlink$4(AbstractHyperlink paramAbstractHyperlink)
  {
    this$0 = paramAbstractHyperlink;
  }
  
  public void handleEvent(Event e)
  {
    switch (type)
    {
    case 15: 
      AbstractHyperlink.access$0(this$0, true);
      this$0.handleEnter(e);
      break;
    case 16: 
      AbstractHyperlink.access$0(this$0, false);
      this$0.handleExit(e);
      break;
    case 14: 
      this$0.handleActivate(e);
      break;
    case 6: 
      this$0.handleEnter(e);
      break;
    case 7: 
      this$0.handleExit(e);
      break;
    case 3: 
      AbstractHyperlink.access$1(this$0, e);
      break;
    case 4: 
      AbstractHyperlink.access$2(this$0, e);
      break;
    case 5: 
      AbstractHyperlink.access$3(this$0, e);
    }
  }
}

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

import org.eclipse.core.runtime.ListenerList;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
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.internal.forms.widgets.FormsResources;

public abstract class AbstractHyperlink
  extends Canvas
{
  private boolean hasFocus;
  boolean paintFocus = true;
  private boolean armed;
  private ListenerList listeners;
  protected int marginWidth = 1;
  protected int marginHeight = 1;
  
  public AbstractHyperlink(Composite parent, int style)
  {
    super(parent, style);
    addListener(1, new Listener()
    {
      public void handleEvent(Event e)
      {
        if (character == '\r') {
          handleActivate(e);
        }
      }
    });
    addPaintListener(new PaintListener()
    {
      public void paintControl(PaintEvent e)
      {
        paint(e);
      }
    });
    addListener(31, new Listener()
    {
      public void handleEvent(Event e)
      {
        switch (detail)
        {
        case 4: 
        case 32: 
        case 64: 
        case 256: 
        case 512: 
          doit = false;
          return;
        }
        doit = true;
      }
    });
    Listener listener = new Listener()
    {
      public void handleEvent(Event e)
      {
        switch (type)
        {
        case 15: 
          hasFocus = true;
          handleEnter(e);
          break;
        case 16: 
          hasFocus = false;
          handleExit(e);
          break;
        case 14: 
          handleActivate(e);
          break;
        case 6: 
          handleEnter(e);
          break;
        case 7: 
          handleExit(e);
          break;
        case 3: 
          AbstractHyperlink.this.handleMouseDown(e);
          break;
        case 4: 
          AbstractHyperlink.this.handleMouseUp(e);
          break;
        case 5: 
          AbstractHyperlink.this.handleMouseMove(e);
        }
      }
    };
    addListener(6, listener);
    addListener(7, listener);
    addListener(3, listener);
    addListener(4, listener);
    addListener(5, listener);
    addListener(15, listener);
    addListener(16, listener);
    setCursor(FormsResources.getHandCursor());
  }
  
  public void addHyperlinkListener(IHyperlinkListener listener)
  {
    if (listeners == null) {
      listeners = new ListenerList();
    }
    listeners.add(listener);
  }
  
  public void removeHyperlinkListener(IHyperlinkListener listener)
  {
    if (listeners == null) {
      return;
    }
    listeners.remove(listener);
  }
  
  public boolean getSelection()
  {
    return hasFocus;
  }
  
  protected void handleEnter(Event e)
  {
    redraw();
    if (listeners == null) {
      return;
    }
    int size = listeners.size();
    HyperlinkEvent he = new HyperlinkEvent(this, getHref(), getText(), 
      stateMask);
    Object[] listenerList = listeners.getListeners();
    for (int i = 0; i < size; i++)
    {
      IHyperlinkListener listener = (IHyperlinkListener)listenerList[i];
      listener.linkEntered(he);
    }
  }
  
  protected void handleExit(Event e)
  {
    armed = false;
    redraw();
    if (listeners == null) {
      return;
    }
    int size = listeners.size();
    HyperlinkEvent he = new HyperlinkEvent(this, getHref(), getText(), 
      stateMask);
    Object[] listenerList = listeners.getListeners();
    for (int i = 0; i < size; i++)
    {
      IHyperlinkListener listener = (IHyperlinkListener)listenerList[i];
      listener.linkExited(he);
    }
  }
  
  protected void handleActivate(Event e)
  {
    armed = false;
    if (listeners == null) {
      return;
    }
    int size = listeners.size();
    setCursor(FormsResources.getBusyCursor());
    HyperlinkEvent he = new HyperlinkEvent(this, getHref(), getText(), 
      stateMask);
    Object[] listenerList = listeners.getListeners();
    for (int i = 0; i < size; i++)
    {
      IHyperlinkListener listener = (IHyperlinkListener)listenerList[i];
      listener.linkActivated(he);
    }
    if (!isDisposed())
    {
      setCursor(FormsResources.getHandCursor());
      triggerAccessible();
    }
  }
  
  void triggerAccessible()
  {
    getAccessible().setFocus(-1);
  }
  
  public void setHref(Object href)
  {
    setData("href", href);
  }
  
  public Object getHref()
  {
    return getData("href");
  }
  
  public String getText()
  {
    return getToolTipText();
  }
  
  protected abstract void paintHyperlink(GC paramGC);
  
  protected void paint(PaintEvent e)
  {
    GC gc = gc;
    Rectangle clientArea = getClientArea();
    if ((width == 0) || (height == 0)) {
      return;
    }
    paintHyperlink(gc);
    if ((paintFocus) && (hasFocus))
    {
      Rectangle carea = getClientArea();
      gc.setForeground(getForeground());
      gc.drawFocus(0, 0, width, height);
    }
  }
  
  private void handleMouseDown(Event e)
  {
    if (button != 1) {
      return;
    }
    armed = true;
  }
  
  private void handleMouseUp(Event e)
  {
    if ((!armed) || (button != 1)) {
      return;
    }
    Point size = getSize();
    if (x < 0) {
      return;
    }
    if (y < 0) {
      return;
    }
    if (x >= x) {
      return;
    }
    if (y >= y) {
      return;
    }
    handleActivate(e);
  }
  
  private void handleMouseMove(Event e)
  {
    if (armed)
    {
      Point size = getSize();
      armed = ((x >= 0) && (y >= 0) && (x < x) && (y < y));
    }
  }
  
  public void setEnabled(boolean enabled)
  {
    boolean needsRedraw = enabled ^ getEnabled();
    super.setEnabled(enabled);
    if (needsRedraw) {
      redraw();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.widgets.AbstractHyperlink
 * 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.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.internal.forms.widgets.ColumnLayoutUtils;

public final class ColumnLayout
  extends Layout
  implements ILayoutExtension
{
  public int minNumColumns = 1;
  public int maxNumColumns = 3;
  public int horizontalSpacing = 5;
  public int verticalSpacing = 5;
  public int topMargin = 5;
  public int leftMargin = 5;
  public int bottomMargin = 5;
  public int rightMargin = 5;
  
  protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache)
  {
    if (wHint == 0) {
      return computeSize(composite, wHint, hHint, minNumColumns);
    }
    if (wHint == -1) {
      return computeSize(composite, wHint, hHint, maxNumColumns);
    }
    return computeSize(composite, wHint, hHint, -1);
  }
  
  private Point computeSize(Composite parent, int wHint, int hHint, int ncolumns)
  {
    Control[] children = parent.getChildren();
    int cwidth = 0;
    int cheight = 0;
    Point[] sizes = new Point[children.length];
    
    int cwHint = -1;
    if (ncolumns != -1)
    {
      cwHint = wHint - leftMargin - rightMargin - (ncolumns - 1) * horizontalSpacing;
      if (cwHint <= 0) {
        cwHint = 0;
      } else {
        cwHint /= ncolumns;
      }
    }
    for (int i = 0; i < children.length; i++)
    {
      sizes[i] = computeControlSize(children[i], cwHint);
      cwidth = Math.max(cwidth, x);
      cheight += y;
    }
    if (ncolumns == -1)
    {
      ncolumns = (wHint - leftMargin - rightMargin - horizontalSpacing) / (cwidth + horizontalSpacing);
      ncolumns = Math.min(ncolumns, children.length);
      ncolumns = Math.max(ncolumns, minNumColumns);
      ncolumns = Math.min(ncolumns, maxNumColumns);
    }
    int perColHeight = ColumnLayoutUtils.computeColumnHeight(ncolumns, sizes, cheight, verticalSpacing);
    int colHeight = 0;
    int[] heights = new int[ncolumns];
    int ncol = 0;
    
    boolean fillIn = false;
    for (int i = 0; i < sizes.length; i++)
    {
      int childHeight = y;
      if ((i > 0) && (colHeight + childHeight > perColHeight))
      {
        heights[ncol] = colHeight;
        ncol++;
        if ((ncol == ncolumns) || (fillIn))
        {
          fillIn = true;
          ncol = findShortestColumn(heights);
        }
        colHeight = heights[ncol];
      }
      if (colHeight > 0) {
        colHeight += verticalSpacing;
      }
      colHeight += childHeight;
    }
    heights[ncol] = Math.max(heights[ncol], colHeight);
    
    Point size = new Point(0, 0);
    for (int i = 0; i < ncolumns; i++) {
      y = Math.max(y, heights[i]);
    }
    x = (cwidth * ncolumns + (ncolumns - 1) * horizontalSpacing);
    x += leftMargin + rightMargin;
    
    y += topMargin + bottomMargin;
    return size;
  }
  
  private Point computeControlSize(Control c, int wHint)
  {
    ColumnLayoutData cd = (ColumnLayoutData)c.getLayoutData();
    int widthHint = cd != null ? widthHint : wHint;
    int heightHint = cd != null ? heightHint : -1;
    return c.computeSize(widthHint, heightHint);
  }
  
  private int findShortestColumn(int[] heights)
  {
    int result = 0;
    int height = Integer.MAX_VALUE;
    for (int i = 0; i < heights.length; i++) {
      if (height > heights[i])
      {
        height = heights[i];
        result = i;
      }
    }
    return result;
  }
  
  protected void layout(Composite parent, boolean flushCache)
  {
    Control[] children = parent.getChildren();
    Rectangle carea = parent.getClientArea();
    int cwidth = 0;
    int cheight = 0;
    Point[] sizes = new Point[children.length];
    for (int i = 0; i < children.length; i++)
    {
      sizes[i] = computeControlSize(children[i], -1);
      cwidth = Math.max(cwidth, x);
      cheight += y;
    }
    int ncolumns = (width - leftMargin - rightMargin + horizontalSpacing) / (cwidth + horizontalSpacing);
    ncolumns = Math.min(ncolumns, children.length);
    ncolumns = Math.max(ncolumns, minNumColumns);
    ncolumns = Math.min(ncolumns, maxNumColumns);
    int realWidth = (width - leftMargin - rightMargin + horizontalSpacing) / ncolumns - horizontalSpacing;
    
    int fillWidth = Math.max(cwidth, realWidth);
    int perColHeight = ColumnLayoutUtils.computeColumnHeight(ncolumns, sizes, cheight, verticalSpacing);
    
    int colHeight = 0;
    int[] heights = new int[ncolumns];
    int ncol = 0;
    int x = leftMargin;
    boolean fillIn = false;
    for (int i = 0; i < sizes.length; i++)
    {
      Control child = children[i];
      Point csize = sizes[i];
      ColumnLayoutData cd = (ColumnLayoutData)child.getLayoutData();
      int align = cd != null ? horizontalAlignment : 4;
      int childWidth = align == 4 ? fillWidth : x;
      if ((i > 0) && (colHeight + y > perColHeight))
      {
        heights[ncol] = colHeight;
        if ((fillIn) || (ncol == ncolumns - 1))
        {
          fillIn = true;
          ncol = findShortestColumn(heights);
          
          x = leftMargin + ncol * (fillWidth + horizontalSpacing);
        }
        else
        {
          ncol++;
          x += fillWidth + horizontalSpacing;
        }
        colHeight = heights[ncol];
      }
      if (colHeight > 0) {
        colHeight += verticalSpacing;
      }
      switch (align)
      {
      case 1: 
      case 4: 
        child.setBounds(x, topMargin + colHeight, childWidth, y);
        break;
      case 3: 
        child.setBounds(x + fillWidth - childWidth, topMargin + colHeight, childWidth, y);
        break;
      case 2: 
        child.setBounds(x + fillWidth / 2 - childWidth / 2, topMargin + colHeight, childWidth, y);
      }
      colHeight = colHeight + y;
    }
  }
  
  public int computeMaximumWidth(Composite parent, boolean changed)
  {
    return computeSize-1-1x;
  }
  
  public int computeMinimumWidth(Composite parent, boolean changed)
  {
    return computeSize0-1x;
  }
}

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

public final class ColumnLayoutData
{
  public int widthHint = -1;
  public int heightHint = -1;
  public static final int LEFT = 1;
  public static final int CENTER = 2;
  public static final int RIGHT = 3;
  public static final int FILL = 4;
  public int horizontalAlignment = 4;
  
  public ColumnLayoutData(int wHint, int hHint)
  {
    widthHint = wHint;
    heightHint = hHint;
  }
  
  public ColumnLayoutData(int wHint)
  {
    widthHint = wHint;
  }
  
  public ColumnLayoutData() {}
}

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

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

class ExpandableComposite$1
  implements PaintListener
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$1(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void paintControl(PaintEvent e)
  {
    this$0.onPaint(e);
  }
}

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

import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class ExpandableComposite$2
  extends HyperlinkAdapter
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$2(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void linkActivated(HyperlinkEvent e)
  {
    ExpandableComposite.access$5(this$0);
  }
}

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

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

class ExpandableComposite$3
  implements PaintListener
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$3(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void paintControl(PaintEvent e)
  {
    if (((this$0.textLabel instanceof Label)) && (!this$0.isFixedStyle())) {
      this$0.textLabel.setForeground(this$0.toggle.hover ? this$0.toggle
        .getHoverDecorationColor() : 
        this$0.getTitleBarForeground());
    }
  }
}

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

import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;

class ExpandableComposite$4
  extends KeyAdapter
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$4(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void keyPressed(KeyEvent e)
  {
    if (keyCode == 16777217)
    {
      ExpandableComposite.access$6(this$0, false);
      doit = false;
    }
    else if (keyCode == 16777218)
    {
      ExpandableComposite.access$6(this$0, true);
      doit = false;
    }
  }
}

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

import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Control;

class ExpandableComposite$5
  implements FocusListener
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$5(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void focusGained(FocusEvent e)
  {
    if (this$0.textLabel != null) {
      this$0.textLabel.redraw();
    }
  }
  
  public void focusLost(FocusEvent e)
  {
    if (this$0.textLabel != null) {
      this$0.textLabel.redraw();
    }
  }
}

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

import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class ExpandableComposite$6
  extends HyperlinkAdapter
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$6(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void linkActivated(HyperlinkEvent e)
  {
    ExpandableComposite.access$7(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.forms.widgets.ExpandableComposite.6
 * 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.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.internal.forms.widgets.FormsResources;

class ExpandableComposite$7
  implements Listener
{
  final ExpandableComposite this$0;
  private final Label val$label;
  
  ExpandableComposite$7(ExpandableComposite paramExpandableComposite, Label paramLabel)
  {
    this$0 = paramExpandableComposite;val$label = paramLabel;
  }
  
  public void handleEvent(Event e)
  {
    switch (type)
    {
    case 3: 
      if (this$0.toggle != null) {
        this$0.toggle.setFocus();
      }
      break;
    case 4: 
      val$label.setCursor(FormsResources.getBusyCursor());
      ExpandableComposite.access$7(this$0);
      val$label.setCursor(FormsResources.getHandCursor());
      break;
    case 6: 
      if (this$0.toggle != null)
      {
        val$label.setForeground(this$0.toggle
          .getHoverDecorationColor());
        this$0.toggle.hover = true;
        this$0.toggle.redraw();
      }
      break;
    case 7: 
      if (this$0.toggle != null)
      {
        val$label.setForeground(this$0.getTitleBarForeground());
        this$0.toggle.hover = false;
        this$0.toggle.redraw();
      }
      break;
    case 9: 
      if ((this$0.toggle != null) && ((this$0.getExpansionStyle() & 0x4000) == 0)) {
        ExpandableComposite.access$8(this$0, gc);
      }
      break;
    }
  }
}

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

import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.ui.internal.forms.widgets.FormUtil;

class ExpandableComposite$8
  implements TraverseListener
{
  final ExpandableComposite this$0;
  
  ExpandableComposite$8(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
  }
  
  public void keyTraversed(TraverseEvent e)
  {
    if (detail == 128)
    {
      if ((!this$0.isVisible()) || (!this$0.isEnabled())) {
        return;
      }
      if (FormUtil.mnemonicMatch(this$0.getText(), character))
      {
        doit = false;
        if (!this$0.isFixedStyle()) {
          ExpandableComposite.access$7(this$0);
        }
        this$0.setFocus();
      }
    }
  }
}

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

import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
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.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.internal.forms.widgets.FormUtil;

class ExpandableComposite$ExpandableLayout
  extends Layout
  implements ILayoutExtension
{
  private SizeCache toggleCache;
  private SizeCache textClientCache;
  private SizeCache textLabelCache;
  private SizeCache descriptionCache;
  private SizeCache clientCache;
  final ExpandableComposite this$0;
  
  ExpandableComposite$ExpandableLayout(ExpandableComposite paramExpandableComposite, ExpandableLayout paramExpandableLayout)
  {
    this(paramExpandableComposite);
  }
  
  private ExpandableComposite$ExpandableLayout(ExpandableComposite paramExpandableComposite)
  {
    this$0 = paramExpandableComposite;
    
    toggleCache = new SizeCache();
    
    textClientCache = new SizeCache();
    
    textLabelCache = new SizeCache();
    
    descriptionCache = new SizeCache();
    
    clientCache = new SizeCache();
  }
  
  private void initCache(boolean shouldFlush)
  {
    toggleCache.setControl(this$0.toggle);
    textClientCache.setControl(ExpandableComposite.access$0(this$0));
    textLabelCache.setControl(this$0.textLabel);
    descriptionCache.setControl(this$0.getDescriptionControl());
    clientCache.setControl(ExpandableComposite.access$1(this$0));
    if (shouldFlush)
    {
      toggleCache.flush();
      textClientCache.flush();
      textLabelCache.flush();
      descriptionCache.flush();
      clientCache.flush();
    }
  }
  
  protected void layout(Composite parent, boolean changed)
  {
    initCache(changed);
    
    Rectangle clientArea = parent.getClientArea();
    int thmargin = 0;
    int tvmargin = 0;
    if (this$0.hasTitleBar())
    {
      thmargin = this$0.titleBarTextMarginWidth;
      tvmargin = 3;
    }
    int x = this$0.marginWidth + thmargin;
    int y = this$0.marginHeight + tvmargin;
    Point tsize = ExpandableComposite.access$2();
    Point tcsize = ExpandableComposite.access$2();
    if (this$0.toggle != null) {
      tsize = toggleCache.computeSize(-1, -1);
    }
    int twidth = width - this$0.marginWidth - this$0.marginWidth - 
      thmargin - thmargin;
    if (x > 0) {
      twidth -= x + 4;
    }
    if (ExpandableComposite.access$0(this$0) != null) {
      tcsize = textClientCache.computeSize(-1, -1);
    }
    Point size = ExpandableComposite.access$2();
    if (this$0.textLabel != null) {
      if ((x > 0) && (FormUtil.isWrapControl(ExpandableComposite.access$0(this$0))))
      {
        size = textLabelCache.computeSize(-1, -1);
        if (twidth < x + 4 + x)
        {
          twidth -= 4;
          if ((this$0.textLabel instanceof Label))
          {
            GC gc = new GC(this$0.textLabel);
            size = FormUtil.computeWrapSize(gc, ((Label)this$0.textLabel).getText(), Math.round(twidth * (x / (x + x))));
            gc.dispose();
          }
          else
          {
            size = textLabelCache.computeSize(Math.round(twidth * (x / (x + x))), -1);
          }
          tcsize = textClientCache.computeSize(twidth - x, -1);
        }
      }
      else
      {
        if (x > 0) {
          twidth -= x + 4;
        }
        size = textLabelCache.computeSize(twidth, -1);
      }
    }
    if ((this$0.textLabel instanceof Label))
    {
      Point defSize = textLabelCache.computeSize(-1, 
        -1);
      if (y == y) {
        x = Math.min(x, x);
      }
    }
    if (this$0.toggle != null)
    {
      GC gc = new GC(this$0);
      gc.setFont(this$0.getFont());
      FontMetrics fm = gc.getFontMetrics();
      int textHeight = fm.getHeight();
      gc.dispose();
      if ((ExpandableComposite.access$0(this$0) != null) && 
        ((ExpandableComposite.access$3(this$0) & 0x2000) != 0)) {
        textHeight = Math.max(textHeight, y);
      }
      int ty = textHeight / 2 - y / 2 + 1;
      ty = Math.max(ty, 0);
      ty += this$0.marginHeight + tvmargin;
      this$0.toggle.setLocation(x, ty);
      this$0.toggle.setSize(tsize);
      x += x + 4;
    }
    if (this$0.textLabel != null)
    {
      int ty = y;
      if ((ExpandableComposite.access$0(this$0) != null) && 
        ((ExpandableComposite.access$3(this$0) & 0x2000) != 0) && 
        (y < y)) {
        ty = y / 2 - y / 2 + this$0.marginHeight + 
          tvmargin;
      }
      String os = System.getProperty("os.name");
      if ("linux".equalsIgnoreCase(os)) {
        x += 1;
      }
      textLabelCache.setBounds(x, ty, x, y);
    }
    if (ExpandableComposite.access$0(this$0) != null)
    {
      int tcx;
      int tcx;
      if ((ExpandableComposite.access$3(this$0) & 0x2000) != 0) {
        tcx = x + x + this$0.GAP;
      } else {
        tcx = width - x - this$0.marginWidth - thmargin;
      }
      textClientCache.setBounds(tcx, y, x, y);
    }
    int tbarHeight = 0;
    if (y > 0) {
      tbarHeight = y;
    }
    if (y > 0) {
      tbarHeight = Math.max(tbarHeight, y);
    }
    y += tbarHeight;
    if (this$0.hasTitleBar()) {
      y += tvmargin;
    }
    if (this$0.getSeparatorControl() != null)
    {
      y += 3;
      this$0.getSeparatorControl().setBounds(this$0.marginWidth, y, 
        width - this$0.marginWidth - this$0.marginWidth, 
        2);
      y += 2;
      if (ExpandableComposite.access$4(this$0)) {
        y += 3;
      }
    }
    if (ExpandableComposite.access$4(this$0))
    {
      int areaWidth = width - this$0.marginWidth - thmargin;
      int cx = this$0.marginWidth + thmargin;
      if ((ExpandableComposite.access$3(this$0) & 0x10) != 0) {
        cx = x;
      }
      areaWidth -= cx;
      if (ExpandableComposite.access$1(this$0) != null)
      {
        Point dsize = null;
        Control desc = this$0.getDescriptionControl();
        if (desc != null)
        {
          dsize = descriptionCache.computeSize(areaWidth, 
            -1);
          y += this$0.descriptionVerticalSpacing;
          descriptionCache.setBounds(cx, y, areaWidth, y);
          y += y + this$0.clientVerticalSpacing;
        }
        else
        {
          y += this$0.clientVerticalSpacing;
          if (this$0.getSeparatorControl() != null) {
            y -= 3;
          }
        }
        int cwidth = areaWidth;
        int cheight = height - this$0.marginHeight - 
          this$0.marginHeight - y;
        clientCache.setBounds(cx, y, cwidth, cheight);
      }
    }
  }
  
  protected Point computeSize(Composite parent, int wHint, int hHint, boolean changed)
  {
    initCache(changed);
    
    int width = 0;int height = 0;
    Point tsize = ExpandableComposite.access$2();
    int twidth = 0;
    if (this$0.toggle != null)
    {
      tsize = toggleCache.computeSize(-1, -1);
      twidth = x + 4;
    }
    int thmargin = 0;
    int tvmargin = 0;
    if (this$0.hasTitleBar())
    {
      thmargin = this$0.titleBarTextMarginWidth;
      tvmargin = 3;
    }
    int innerwHint = wHint;
    if (innerwHint != -1) {
      innerwHint = innerwHint - (twidth + this$0.marginWidth + this$0.marginWidth + thmargin + thmargin);
    }
    int innertHint = innerwHint;
    
    Point tcsize = ExpandableComposite.access$2();
    if (ExpandableComposite.access$0(this$0) != null) {
      tcsize = textClientCache.computeSize(-1, -1);
    }
    Point size = ExpandableComposite.access$2();
    if (this$0.textLabel != null) {
      if ((x > 0) && (FormUtil.isWrapControl(ExpandableComposite.access$0(this$0))))
      {
        size = textLabelCache.computeSize(-1, -1);
        if ((innertHint != -1) && (innertHint < x + 4 + x))
        {
          innertHint -= 4;
          if ((this$0.textLabel instanceof Label))
          {
            GC gc = new GC(this$0.textLabel);
            size = FormUtil.computeWrapSize(gc, ((Label)this$0.textLabel).getText(), Math.round(innertHint * (x / (x + x))));
            gc.dispose();
          }
          else
          {
            size = textLabelCache.computeSize(Math.round(innertHint * (x / (x + x))), -1);
          }
          tcsize = textClientCache.computeSize(innertHint - x, -1);
        }
      }
      else
      {
        if ((innertHint != -1) && (x > 0)) {
          innertHint -= 4 + x;
        }
        size = textLabelCache.computeSize(innertHint, -1);
      }
    }
    if ((this$0.textLabel instanceof Label))
    {
      Point defSize = textLabelCache.computeSize(-1, 
        -1);
      if (y == y) {
        x = Math.min(x, x);
      }
    }
    if (x > 0) {
      width = x;
    }
    if (x > 0) {
      width += 4 + x;
    }
    if (this$0.toggle != null) {
      width += twidth;
    }
    height = y > 0 ? Math.max(y, y) : y;
    if (this$0.getSeparatorControl() != null)
    {
      height += 5;
      if ((ExpandableComposite.access$4(this$0)) && (ExpandableComposite.access$1(this$0) != null)) {
        height += 3;
      }
    }
    if (((ExpandableComposite.access$4(this$0)) || ((ExpandableComposite.access$3(this$0) & 0x20) == 0)) && (ExpandableComposite.access$1(this$0) != null))
    {
      int cwHint = wHint;
      int clientIndent = 0;
      if ((ExpandableComposite.access$3(this$0) & 0x10) != 0) {
        clientIndent = twidth;
      }
      if (cwHint != -1)
      {
        cwHint -= this$0.marginWidth + this$0.marginWidth + thmargin + thmargin;
        if (((ExpandableComposite.access$3(this$0) & 0x10) != 0) && 
          (x > 0)) {
          cwHint -= twidth;
        }
      }
      Point dsize = null;
      Point csize = clientCache.computeSize(FormUtil.getWidthHint(
        cwHint, ExpandableComposite.access$1(this$0)), -1);
      if (this$0.getDescriptionControl() != null)
      {
        int dwHint = cwHint;
        if (dwHint == -1)
        {
          dwHint = x;
          if ((ExpandableComposite.access$3(this$0) & 0x10) != 0) {
            dwHint -= twidth;
          }
        }
        dsize = descriptionCache.computeSize(dwHint, -1);
      }
      if (dsize != null)
      {
        width = Math.max(width, x + clientIndent);
        if (ExpandableComposite.access$4(this$0)) {
          height = height + (this$0.descriptionVerticalSpacing + y + this$0.clientVerticalSpacing);
        }
      }
      else
      {
        height += this$0.clientVerticalSpacing;
        if (this$0.getSeparatorControl() != null) {
          height -= 3;
        }
      }
      width = Math.max(width, x + clientIndent);
      if (ExpandableComposite.access$4(this$0)) {
        height += y;
      }
    }
    if (this$0.toggle != null) {
      height = height - y + Math.max(y, y);
    }
    Point result = new Point(width + this$0.marginWidth + this$0.marginWidth + 
      thmargin + thmargin, height + this$0.marginHeight + this$0.marginHeight + 
      tvmargin + tvmargin);
    return result;
  }
  
  public int computeMinimumWidth(Composite parent, boolean changed)
  {
    return computeSize0-1x;
  }
  
  public int computeMaximumWidth(Composite parent, boolean changed)
  {
    return computeSize-1-1x;
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.events.IExpansionListener;
import org.eclipse.ui.internal.forms.widgets.FormUtil;
import org.eclipse.ui.internal.forms.widgets.FormsResources;

public class ExpandableComposite
  extends Canvas
{
  public static final int TWISTIE = 2;
  public static final int TREE_NODE = 4;
  public static final int FOCUS_TITLE = 8;
  public static final int CLIENT_INDENT = 16;
  public static final int COMPACT = 32;
  public static final int EXPANDED = 64;
  public static final int TITLE_BAR = 256;
  public static final int SHORT_TITLE_BAR = 512;
  public static final int NO_TITLE = 4096;
  public static final int LEFT_TEXT_CLIENT_ALIGNMENT = 8192;
  public static final int NO_TITLE_FOCUS_BOX = 16384;
  public int marginWidth = 0;
  public int marginHeight = 0;
  public int clientVerticalSpacing = 3;
  public int descriptionVerticalSpacing = 0;
  public int titleBarTextMarginWidth = 6;
  protected ToggleHyperlink toggle;
  protected Control textLabel;
  /**
   * @deprecated
   */
  protected int VGAP = 3;
  /**
   * @deprecated
   */
  protected int GAP = 4;
  static final int IGAP = 4;
  static final int IVGAP = 3;
  private static fina
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