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

st list)
  {
    for (int i = 0; i < list.size(); i++)
    {
      Message message = (Message)list.get(i);
      if (message.getKey().equals(key)) {
        return message;
      }
    }
    return null;
  }
  
  public void update()
  {
    for (Iterator iter = decorators.values().iterator(); iter.hasNext();)
    {
      ControlDecorator dec = (ControlDecorator)iter.next();
      dec.update();
    }
    updateForm();
  }
  
  private void updateForm()
  {
    ArrayList mergedList = new ArrayList();
    mergedList.addAll(messages);
    for (Enumeration enm = decorators.elements(); enm.hasMoreElements();)
    {
      ControlDecorator dec = (ControlDecorator)enm.nextElement();
      dec.addAll(mergedList);
    }
    update(mergedList);
  }
  
  private void update(ArrayList mergedList)
  {
    pruneControlDecorators();
    if ((form.getHead().getBounds().height == 0) || (mergedList.isEmpty()) || (mergedList == null))
    {
      form.setMessage(null, 0);
      return;
    }
    ArrayList peers = createPeers(mergedList);
    int maxType = ((IMessage)peers.get(0)).getMessageType();
    
    IMessage[] array = (IMessage[])peers
      .toArray(new IMessage[peers.size()]);
    if ((peers.size() == 1) && (get0prefix == null))
    {
      IMessage message = (IMessage)peers.get(0);
      String messageText = message.getMessage();
      form.setMessage(messageText, maxType, array);
    }
    else
    {
      String messageText;
      String messageText;
      if (peers.size() > 1) {
        messageText = Messages.bind(
          MULTIPLE_MESSAGE_SUMMARY_KEYS[maxType], 
          new String[] { peers.size() });
      } else {
        messageText = SINGLE_MESSAGE_SUMMARY_KEYS[maxType];
      }
      form.setMessage(messageText, maxType, array);
    }
  }
  
  private static String getFullMessage(IMessage message)
  {
    if (message.getPrefix() == null) {
      return message.getMessage();
    }
    return message.getPrefix() + message.getMessage();
  }
  
  private ArrayList createPeers(ArrayList messages)
  {
    ArrayList peers = new ArrayList();
    int maxType = 0;
    for (int i = 0; i < messages.size(); i++)
    {
      Message message = (Message)messages.get(i);
      if (type > maxType)
      {
        peers.clear();
        maxType = type;
      }
      if (type == maxType) {
        peers.add(message);
      }
    }
    return peers;
  }
  
  private String createDetails(ArrayList messages, boolean excludePrefix)
  {
    StringWriter sw = new StringWriter();
    PrintWriter out = new PrintWriter(sw);
    for (int i = 0; i < messages.size(); i++)
    {
      if (i > 0) {
        out.println();
      }
      IMessage m = (IMessage)messages.get(i);
      out.print(excludePrefix ? m.getMessage() : getFullMessage(m));
    }
    out.flush();
    return sw.toString();
  }
  
  public static String createDetails(IMessage[] messages)
  {
    if ((messages == null) || (messages.length == 0)) {
      return null;
    }
    StringWriter sw = new StringWriter();
    PrintWriter out = new PrintWriter(sw);
    for (int i = 0; i < messages.length; i++)
    {
      if (i > 0) {
        out.println();
      }
      out.print(getFullMessage(messages[i]));
    }
    out.flush();
    return sw.toString();
  }
  
  public String createSummary(IMessage[] messages)
  {
    return createDetails(messages);
  }
  
  private void pruneControlDecorators()
  {
    for (Iterator iter = decorators.values().iterator(); iter.hasNext();)
    {
      ControlDecorator dec = (ControlDecorator)iter.next();
      if (dec.isDisposed()) {
        iter.remove();
      }
    }
  }
  
  public IMessagePrefixProvider getMessagePrefixProvider()
  {
    return prefixProvider;
  }
  
  public void setMessagePrefixProvider(IMessagePrefixProvider provider)
  {
    prefixProvider = provider;
    for (Iterator iter = decorators.values().iterator(); iter.hasNext();)
    {
      ControlDecorator dec = (ControlDecorator)iter.next();
      dec.updatePrefix();
    }
  }
  
  public int getDecorationPosition()
  {
    return decorationPosition;
  }
  
  public void setDecorationPosition(int position)
  {
    decorationPosition = position;
    for (Iterator iter = decorators.values().iterator(); iter.hasNext();)
    {
      ControlDecorator dec = (ControlDecorator)iter.next();
      dec.updatePosition();
    }
  }
  
  public boolean isAutoUpdate()
  {
    return autoUpdate;
  }
  
  public void setAutoUpdate(boolean autoUpdate)
  {
    boolean needsCaching = (this.autoUpdate) && (!autoUpdate);
    boolean needsUpdate = (!this.autoUpdate) && (autoUpdate);
    this.autoUpdate = autoUpdate;
    if ((needsUpdate) && (isCacheChanged())) {
      update();
    }
    if (needsCaching)
    {
      oldMessages = new ArrayList();
      for (Iterator i = messages.iterator(); i.hasNext();) {
        oldMessages.add(new Message((Message)i.next(), null));
      }
      oldDecorators = new Hashtable();
      for (Enumeration e = decorators.keys(); e.hasMoreElements();)
      {
        Object key = e.nextElement();
        oldDecorators.put(key, new ControlDecorator((ControlDecorator)decorators.get(key), null));
      }
    }
  }
  
  private boolean isCacheChanged()
  {
    boolean result = false;
    result = (checkMessageCache()) || (checkDecoratorCache());
    oldMessages.clear();
    oldMessages = null;
    oldDecorators.clear();
    oldDecorators = null;
    return result;
  }
  
  private boolean checkMessageCache()
  {
    if (oldMessages == null) {
      return false;
    }
    if (messages.size() != oldMessages.size()) {
      return true;
    }
    if (!oldMessages.containsAll(messages)) {
      return true;
    }
    return false;
  }
  
  private boolean checkDecoratorCache()
  {
    if (oldDecorators == null) {
      return false;
    }
    for (Iterator i = decorators.entrySet().iterator(); i.hasNext();)
    {
      Map.Entry next = (Map.Entry)i.next();
      ControlDecorator cd = (ControlDecorator)next.getValue();
      ControlDecorator oldCd = (ControlDecorator)oldDecorators.get(decoration.getControl());
      if (((oldCd == null) && (controlMessages.size() > 0)) || ((oldCd != null) && (!cd.hasSameMessages(oldCd)))) {
        return true;
      }
    }
    return false;
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.ui.internal.forms.Messages";
  public static String FormDialog_defaultTitle;
  public static String FormText_copy;
  public static String Form_tooltip_minimize;
  public static String Form_tooltip_restore;
  public static String MessageManager_sMessageSummary;
  public static String MessageManager_sWarningSummary;
  public static String MessageManager_sErrorSummary;
  public static String MessageManager_pMessageSummary;
  public static String MessageManager_pWarningSummary;
  public static String MessageManager_pErrorSummary;
  public static String ToggleHyperlink_accessibleColumn;
  public static String ToggleHyperlink_accessibleName;
  
  static
  {
    NLS.initializeMessages("org.eclipse.ui.internal.forms.Messages", Messages.class);
  }
}

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

import java.util.Hashtable;
import java.util.Vector;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;

public class AggregateHyperlinkSegment
  extends ParagraphSegment
  implements IHyperlinkSegment
{
  private String href;
  private Vector segments = new Vector();
  
  public void add(TextHyperlinkSegment segment)
  {
    segments.add(segment);
  }
  
  public void add(ImageHyperlinkSegment segment)
  {
    segments.add(segment);
  }
  
  public boolean advanceLocator(GC gc, int wHint, Locator loc, Hashtable objectTable, boolean computeHeightOnly)
  {
    boolean newLine = false;
    for (int i = 0; i < segments.size(); i++)
    {
      ParagraphSegment segment = (ParagraphSegment)segments.get(i);
      if (segment.advanceLocator(gc, wHint, loc, objectTable, 
        computeHeightOnly)) {
        newLine = true;
      }
    }
    return newLine;
  }
  
  public String getHref()
  {
    return href;
  }
  
  public void setHref(String href)
  {
    this.href = href;
  }
  
  public void paint(GC gc, boolean hover, Hashtable resourceTable, boolean selected, SelectionData selData, Rectangle repaintRegion)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      ParagraphSegment segment = (ParagraphSegment)segments.get(i);
      segment.paint(gc, hover, resourceTable, selected, selData, 
        repaintRegion);
    }
  }
  
  public String getText()
  {
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < segments.size(); i++)
    {
      IHyperlinkSegment segment = (IHyperlinkSegment)segments.get(i);
      buf.append(segment.getText());
    }
    return buf.toString();
  }
  
  public void paintFocus(GC gc, Color bg, Color fg, boolean selected, Rectangle repaintRegion)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      IHyperlinkSegment segment = (IHyperlinkSegment)segments.get(i);
      segment.paintFocus(gc, bg, fg, selected, repaintRegion);
    }
  }
  
  public Rectangle getBounds()
  {
    if (segments.size() == 0) {
      return new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0);
    }
    IHyperlinkSegment segment0 = (IHyperlinkSegment)segments.get(0);
    Rectangle bounds = segment0.getBounds();
    for (int i = 1; i < segments.size(); i++)
    {
      IHyperlinkSegment segment = (IHyperlinkSegment)segments.get(i);
      Rectangle sbounds = segment.getBounds();
      bounds.add(sbounds);
    }
    return bounds;
  }
  
  public boolean contains(int x, int y)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      IHyperlinkSegment segment = (IHyperlinkSegment)segments.get(i);
      if (segment.contains(x, y)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean intersects(Rectangle rect)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      IHyperlinkSegment segment = (IHyperlinkSegment)segments.get(i);
      if (segment.intersects(rect)) {
        return true;
      }
    }
    return false;
  }
  
  public void layout(GC gc, int width, Locator locator, Hashtable resourceTable, boolean selected)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      ParagraphSegment segment = (ParagraphSegment)segments.get(i);
      segment.layout(gc, width, locator, resourceTable, selected);
    }
  }
  
  public void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      ParagraphSegment segment = (ParagraphSegment)segments.get(i);
      segment.computeSelection(gc, resourceTable, selData);
    }
  }
  
  public void clearCache(String fontId)
  {
    for (int i = 0; i < segments.size(); i++)
    {
      ParagraphSegment segment = (ParagraphSegment)segments.get(i);
      segment.clearCache(fontId);
    }
  }
  
  public String getTooltipText()
  {
    if (segments.size() > 0) {
      return ((ParagraphSegment)segments.get(0)).getTooltipText();
    }
    return super.getTooltipText();
  }
  
  public boolean isFocusSelectable(Hashtable resourceTable)
  {
    return true;
  }
  
  public boolean setFocus(Hashtable resourceTable, boolean direction)
  {
    return true;
  }
}

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

import java.util.Hashtable;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;

public class BreakSegment
  extends ParagraphSegment
{
  public boolean advanceLocator(GC gc, int wHint, Locator locator, Hashtable objectTable, boolean computeHeightOnly)
  {
    if (rowHeight == 0)
    {
      FontMetrics fm = gc.getFontMetrics();
      rowHeight = fm.getHeight();
    }
    if (computeHeightOnly) {
      locator.collectHeights();
    }
    locator.resetCaret();
    width = x;
    y += rowHeight;
    rowHeight = 0;
    leading = 0;
    return true;
  }
  
  public void paint(GC gc, boolean hover, Hashtable resourceTable, boolean selected, SelectionData selData, Rectangle repaintRegion) {}
  
  public boolean contains(int x, int y)
  {
    return false;
  }
  
  public boolean intersects(Rectangle rect)
  {
    return false;
  }
  
  public void layout(GC gc, int width, Locator locator, Hashtable ResourceTable, boolean selected)
  {
    locator.resetCaret();
    if (rowHeight == 0)
    {
      FontMetrics fm = gc.getFontMetrics();
      rowHeight = fm.getHeight();
    }
    y += rowHeight;
    rowHeight = 0;
    rowCounter += 1;
  }
  
  public void computeSelection(GC gc, Hashtable resourceTable, SelectionData selData)
  {
    selData.markNewLine();
  }
}

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

import java.util.Hashtable;
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;

public class BulletParagraph
  extends Paragraph
{
  public static final int CIRCLE = 1;
  public static final int TEXT = 2;
  public static final int IMAGE = 3;
  private int style = 1;
  private String text;
  private int CIRCLE_DIAM = 5;
  private int SPACING = 10;
  private int indent = -1;
  private int bindent = -1;
  private Rectangle bbounds;
  
  public BulletParagraph(boolean addVerticalSpace)
  {
    super(addVerticalSpace);
  }
  
  public int getIndent()
  {
    int ivalue = indent;
    if (ivalue != -1) {
      return ivalue;
    }
    switch (style)
    {
    case 1: 
      ivalue = CIRCLE_DIAM + SPACING;
      break;
    default: 
      ivalue = 20;
    }
    return getBulletIndent() + ivalue;
  }
  
  public int getBulletIndent()
  {
    if (bindent != -1) {
      return bindent;
    }
    return 0;
  }
  
  public int getBulletStyle()
  {
    return style;
  }
  
  public void setBulletStyle(int style)
  {
    this.style = style;
  }
  
  public void setBulletText(String text)
  {
    this.text = text;
  }
  
  public void setIndent(int indent)
  {
    this.indent = indent;
  }
  
  public void setBulletIndent(int bindent)
  {
    this.bindent = bindent;
  }
  
  public String getBulletText()
  {
    return text;
  }
  
  public void layout(GC gc, int width, Locator loc, int lineHeight, Hashtable resourceTable, IHyperlinkSegment selectedLink)
  {
    computeRowHeights(gc, width, loc, lineHeight, resourceTable);
    layoutBullet(gc, loc, lineHeight, resourceTable);
    super.layout(gc, width, loc, lineHeight, resourceTable, selectedLink);
  }
  
  public void paint(GC gc, Rectangle repaintRegion, Hashtable resourceTable, IHyperlinkSegment selectedLink, SelectionData selData)
  {
    paintBullet(gc, repaintRegion, resourceTable);
    super.paint(gc, repaintRegion, resourceTable, selectedLink, selData);
  }
  
  private void layoutBullet(GC gc, Locator loc, int lineHeight, Hashtable resourceTable)
  {
    int x = x - getIndent() + getBulletIndent();
    int rowHeight = ((int[])heights.get(0))[0];
    if (style == 1)
    {
      int y = y + rowHeight / 2 - CIRCLE_DIAM / 2;
      bbounds = new Rectangle(x, y, CIRCLE_DIAM, CIRCLE_DIAM);
    }
    else if ((style == 2) && (text != null))
    {
      Point textSize = gc.textExtent(text);
      bbounds = new Rectangle(x, y, x, y);
    }
    else if ((style == 3) && (text != null))
    {
      Image image = (Image)resourceTable.get(text);
      if (image != null)
      {
        Rectangle ibounds = image.getBounds();
        int y = y + rowHeight / 2 - height / 2;
        bbounds = new Rectangle(x, y, width, height);
      }
    }
  }
  
  public void paintBullet(GC gc, Rectangle repaintRegion, Hashtable resourceTable)
  {
    if (bbounds == null) {
      return;
    }
    int x = bbounds.x;
    int y = bbounds.y;
    if (repaintRegion != null)
    {
      x -= x;
      y -= y;
    }
    if (style == 1)
    {
      Color bg = gc.getBackground();
      Color fg = gc.getForeground();
      gc.setBackground(fg);
      gc.fillRectangle(x, y + 1, 5, 3);
      gc.fillRectangle(x + 1, y, 3, 5);
      gc.setBackground(bg);
    }
    else if ((style == 2) && (text != null))
    {
      gc.drawText(text, x, y);
    }
    else if ((style == 3) && (text != null))
    {
      Image image = (Image)resourceTable.get(text);
      if (image != null) {
        gc.drawImage(image, x, y);
      }
    }
  }
}

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

import org.eclipse.swt.widgets.Display;

class BusyIndicator$1
  implements Runnable
{
  final BusyIndicator this$0;
  
  BusyIndicator$1(BusyIndicator paramBusyIndicator)
  {
    this$0 = paramBusyIndicator;
  }
  
  public void run()
  {
    if (this$0.isDisposed()) {
      return;
    }
    this$0.redraw();
    if (!BusyIndicator.access$0(this$0)) {
      return;
    }
    this$0.update();
    if (this$0.isDisposed()) {
      return;
    }
    BusyIndicator.access$2(this$0, (BusyIndicator.access$1(this$0) + 1) % 8);
    BusyIndicator.access$3(this$0).timerExec(180, this);
  }
}

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

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

class BusyIndicator$2
  implements PaintListener
{
  final BusyIndicator this$0;
  
  BusyIndicator$2(BusyIndicator paramBusyIndicator)
  {
    this$0 = paramBusyIndicator;
  }
  
  public void paintControl(PaintEvent event)
  {
    this$0.onPaint(event);
  }
}

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

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

class BusyIndicator$3
  implements DisposeListener
{
  final BusyIndicator this$0;
  
  BusyIndicator$3(BusyIndicator paramBusyIndicator)
  {
    this$0 = paramBusyIndicator;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    BusyIndicator.access$4(this$0);
  }
}

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

import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
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.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.osgi.framework.Bundle;

public final class BusyIndicator
  extends Canvas
{
  private static final int MARGIN = 0;
  private static final int IMAGE_COUNT = 8;
  private static final int MILLISECONDS_OF_DELAY = 180;
  private Image[] imageCache;
  private Image image;
  private Display dpy;
  private Runnable timer;
  private boolean busy;
  private int imageIndex;
  
  public BusyIndicator(Composite parent, int style)
  {
    super(parent, style | 0x20000000);
    
    dpy = getDisplay();
    timer = new Runnable()
    {
      public void run()
      {
        if (isDisposed()) {
          return;
        }
        redraw();
        if (!busy) {
          return;
        }
        update();
        if (isDisposed()) {
          return;
        }
        imageIndex = ((imageIndex + 1) % 8);
        dpy.timerExec(180, this);
      }
    };
    addPaintListener(new PaintListener()
    {
      public void paintControl(PaintEvent event)
      {
        onPaint(event);
      }
    });
    addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent e)
      {
        BusyIndicator.this.clearImages();
      }
    });
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    Point size = new Point(0, 0);
    if (image != null)
    {
      Rectangle ibounds = image.getBounds();
      x = width;
      y = height;
    }
    if (isBusy())
    {
      Rectangle bounds = getImage(0).getBounds();
      x = Math.max(x, width);
      y = Math.max(y, height);
    }
    x += 0;
    y += 0;
    return size;
  }
  
  public boolean forceFocus()
  {
    return false;
  }
  
  public Image getImage()
  {
    return image;
  }
  
  public boolean isBusy()
  {
    return busy;
  }
  
  void onPaint(PaintEvent event)
  {
    Rectangle rect = getClientArea();
    if ((width == 0) || (height == 0)) {
      return;
    }
    Image activeImage;
    Image activeImage;
    if (isBusy())
    {
      activeImage = getImage(imageIndex);
    }
    else
    {
      clearImages();
      activeImage = image;
    }
    if (activeImage != null)
    {
      GC gc = gc;
      Rectangle ibounds = activeImage.getBounds();
      gc.drawImage(activeImage, width / 2 - width / 2, 
        height / 2 - height / 2);
    }
  }
  
  public synchronized void setBusy(boolean busy)
  {
    if (this.busy == busy) {
      return;
    }
    this.busy = busy;
    imageIndex = 0;
    dpy.asyncExec(timer);
  }
  
  public void setImage(Image image)
  {
    if ((image != this.image) && (!isDisposed()))
    {
      this.image = image;
      redraw();
    }
  }
  
  private ImageDescriptor createImageDescriptor(String relativePath)
  {
    Bundle bundle = Platform.getBundle("org.eclipse.ui.forms");
    URL url = FileLocator.find(bundle, new Path(relativePath), null);
    if (url == null) {
      return null;
    }
    try
    {
      url = FileLocator.resolve(url);
      return ImageDescriptor.createFromURL(url);
    }
    catch (IOException localIOException) {}
    return null;
  }
  
  private Image getImage(int index)
  {
    if (imageCache == null) {
      imageCache = new Image[8];
    }
    if (imageCache[index] == null)
    {
      ImageDescriptor descriptor = createImageDescriptor("$nl$/icons/progress/ani/" + (index + 1) + ".png");
      imageCache[index] = descriptor.createImage();
    }
    return imageCache[index];
  }
  
  private void clearImages()
  {
    if (imageCache != null) {
      for (int index = 0; index < 8; index++) {
        if ((imageCache[index] != null) && (!imageCache[index].isDisposed()))
        {
          imageCache[index].dispose();
          imageCache[index] = null;
        }
      }
    }
  }
}

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

import org.eclipse.swt.graphics.Point;

public class ColumnLayoutUtils
{
  public static int computeColumnHeight(int ncolumns, Point[] sizes, int totalHeight, int verticalMargin)
  {
    int averageHeight = (totalHeight + sizes.length * verticalMargin) / ncolumns;
    int requiredHeight = computeActualHeight(ncolumns, sizes, averageHeight, verticalMargin);
    if (averageHeight == requiredHeight) {
      return requiredHeight;
    }
    for (int i = 0; i < 10; i++)
    {
      int candidateHeight = computeActualHeight(ncolumns, sizes, requiredHeight - 1, verticalMargin);
      if (candidateHeight >= requiredHeight) {
        return requiredHeight;
      }
      requiredHeight = candidateHeight;
    }
    return requiredHeight;
  }
  
  private static int computeActualHeight(int ncolumns, Point[] sizes, int candidateHeight, int verticalMargin)
  {
    int colHeight = 0;
    int maxHeight = 0;
    int column = 1;
    for (int i = 0; i < sizes.length; i++)
    {
      int childHeight = y;
      if ((i > 0) && (column < ncolumns) && (colHeight + childHeight + verticalMargin > candidateHeight))
      {
        maxHeight = Math.max(colHeight, maxHeight);
        column++;
        colHeight = 0;
      }
      if (colHeight > 0) {
        colHeight += verticalMargin;
      }
      colHeight += childHeight;
    }
    maxHeight = Math.max(colHeight, maxHeight);
    return maxHeight;
  }
}

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

import java.util.Hashtable;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;

public class ControlSegment
  extends ObjectSegment
  implements IFocusSelectable
{
  private boolean fill;
  private int width = -1;
  private int height = -1;
  
  public void setFill(boolean fill)
  {
    this.fill = fill;
  }
  
  public void setWidth(int width)
  {
    this.width = width;
  }
  
  public void setHeight(int height)
  {
    this.height = height;
  }
  
  public Control getControl(Hashtable resourceTable)
  {
    Object obj = resourceTable.get(getObjectId());
    if ((obj instanceof Control))
    {
      Control c = (Control)obj;
      if (!c.isDisposed()) {
        return c;
      }
    }
    return null;
  }
  
  protected Point getObjectSize(Hashtable resourceTable, int wHint)
  {
    Control control = getControl(resourceTable);
    if (control == null) {
      return new Point(0, 0);
    }
    int realWhint = FormUtil.getWidthHint(wHint, control);
    Point size = control.computeSize(realWhint, -1);
    if ((realWhint != -1) && (fill)) {
      x = Math.max(x, realWhint);
    }
    if (width != -1) {
      x = width;
    }
    if (height != -1) {
      y = height;
    }
    return size;
  }
  
  public void layout(GC gc, int width, Locator loc, Hashtable resourceTable, boolean selected)
  {
    super.layout(gc, width, loc, resourceTable, selected);
    Control control = getControl(resourceTable);
    if (control != null) {
      control.setBounds(getBounds());
    }
  }
  
  public boolean setFocus(Hashtable resourceTable, boolean next)
  {
    Control c = getControl(resourceTable);
    if (c != null) {
      return setFocus(c, next);
    }
    return false;
  }
  
  private boolean setFocus(Control c, boolean direction)
  {
    if ((c instanceof Composite))
    {
      Composite comp = (Composite)c;
      Control[] tabList = comp.getTabList();
      if (direction) {
        for (int i = 0; i < tabList.length; i++) {
          if (setFocus(tabList[i], direction)) {
            return true;
          }
        }
      } else {
        for (int i = tabList.length - 1; i >= 0; i--) {
          if (setFocus(tabList[i], direction)) {
            return true;
          }
        }
      }
      if (!(c instanceof Canvas)) {
        return false;
      }
    }
    return c.setFocus();
  }
  
  public boolean isFocusSelectable(Hashtable resourceTable)
  {
    Control c = getControl(resourceTable);
    if (c != null) {
      return true;
    }
    return false;
  }
}

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

import org.eclipse.jface.resource.DeviceResourceException;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;

class FormFonts$BoldFontDescriptor
  extends FontDescriptor
{
  private FontData[] fFontData;
  final FormFonts this$0;
  
  FormFonts$BoldFontDescriptor(FormFonts arg1, Font font)
  {
    this$0 = ???;
    fFontData = font.getFontData();
    for (int i = 0; i < fFontData.length; i++) {
      fFontData[i].setStyle(fFontData[i].getStyle() | 0x1);
    }
  }
  
  public boolean equals(Object obj)
  {
    if ((obj instanceof BoldFontDescriptor))
    {
      BoldFontDescriptor desc = (BoldFontDescriptor)obj;
      if (fFontData.length != fFontData.length) {
        return false;
      }
      for (int i = 0; i < fFontData.length; i++) {
        if (!fFontData[i].equals(fFontData[i])) {
          return false;
        }
      }
      return true;
    }
    return false;
  }
  
  public int hashCode()
  {
    int hash = 0;
    for (int i = 0; i < fFontData.length; i++) {
      hash = hash * 7 + fFontData[i].hashCode();
    }
    return hash;
  }
  
  public Font createFont(Device device)
    throws DeviceResourceException
  {
    return new Font(device, fFontData);
  }
  
  public void destroyFont(Font previouslyCreatedFont)
  {
    previouslyCreatedFont.dispose();
  }
}

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

import java.util.HashMap;
import org.eclipse.jface.resource.DeviceResourceException;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Display;

public class FormFonts
{
  private static FormFonts instance;
  
  public static FormFonts getInstance()
  {
    if (instance == null) {
      instance = new FormFonts();
    }
    return instance;
  }
  
  private ResourceManagerManger manager = new ResourceManagerManger();
  private HashMap descriptors;
  
  private class BoldFontDescriptor
    extends FontDescriptor
  {
    private FontData[] fFontData;
    
    BoldFontDescriptor(Font font)
    {
      fFontData = font.getFontData();
      for (int i = 0; i < fFontData.length; i++) {
        fFontData[i].setStyle(fFontData[i].getStyle() | 0x1);
      }
    }
    
    public boolean equals(Object obj)
    {
      if ((obj instanceof BoldFontDescriptor))
      {
        BoldFontDescriptor desc = (BoldFontDescriptor)obj;
        if (fFontData.length != fFontData.length) {
          return false;
        }
        for (int i = 0; i < fFontData.length; i++) {
          if (!fFontData[i].equals(fFontData[i])) {
            return false;
          }
        }
        return true;
      }
      return false;
    }
    
    public int hashCode()
    {
      int hash = 0;
      for (int i = 0; i < fFontData.length; i++) {
        hash = hash * 7 + fFontData[i].hashCode();
      }
      return hash;
    }
    
    public Font createFont(Device device)
      throws DeviceResourceException
    {
      return new Font(device, fFontData);
    }
    
    public void destroyFont(Font previouslyCreatedFont)
    {
      previouslyCreatedFont.dispose();
    }
  }
  
  public Font getBoldFont(Display display, Font font)
  {
    checkHashMaps();
    BoldFontDescriptor desc = new BoldFontDescriptor(font);
    Font result = manager.getResourceManager(display).createFont(desc);
    descriptors.put(result, desc);
    return result;
  }
  
  public boolean markFinished(Font boldFont, Display display)
  {
    checkHashMaps();
    BoldFontDescriptor desc = (BoldFontDescriptor)descriptors.get(boldFont);
    if (desc != null)
    {
      LocalResourceManager resourceManager = manager.getResourceManager(display);
      resourceManager.destroyFont(desc);
      if (resourceManager.find(desc) == null)
      {
        descriptors.remove(boldFont);
        validateHashMaps();
      }
      return true;
    }
    boldFont.dispose();
    return false;
  }
  
  private void checkHashMaps()
  {
    if (descriptors == null) {
      descriptors = new HashMap();
    }
  }
  
  private void validateHashMaps()
  {
    if (descriptors.size() == 0) {
      descriptors = null;
    }
  }
}

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

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

class FormHeading$1
  implements Listener
{
  final FormHeading this$0;
  
  FormHeading$1(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void handleEvent(Event e)
  {
    FormHeading.access$10(this$0, gc);
  }
}

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

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

class FormHeading$2
  implements Listener
{
  final FormHeading this$0;
  
  FormHeading$2(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void handleEvent(Event e)
  {
    if (FormHeading.access$11(this$0) != null)
    {
      FormImages.getInstance().markFinished(FormHeading.access$11(this$0), this$0.getDisplay());
      FormHeading.access$12(this$0, null);
    }
  }
}

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

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

class FormHeading$3
  implements Listener
{
  final FormHeading this$0;
  
  FormHeading$3(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void handleEvent(Event e)
  {
    if ((FormHeading.access$13(this$0) != null) || (
      (FormHeading.access$14(this$0) != null) && (!this$0.isBackgroundImageTiled()))) {
      FormHeading.access$15(this$0);
    }
  }
}

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

import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;

class FormHeading$4
  implements MouseMoveListener
{
  final FormHeading this$0;
  
  FormHeading$4(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void mouseMove(MouseEvent e)
  {
    FormHeading.access$16(this$0, e);
  }
}

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

import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseTrackListener;

class FormHeading$5
  implements MouseTrackListener
{
  final FormHeading this$0;
  
  FormHeading$5(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void mouseEnter(MouseEvent e)
  {
    FormHeading.access$16(this$0, e);
  }
  
  public void mouseExit(MouseEvent e)
  {
    FormHeading.access$1(this$0).setHoverState(0);
  }
  
  public void mouseHover(MouseEvent e) {}
}

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

import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class FormHeading$6
  implements DisposeListener
{
  final FormHeading this$0;
  
  FormHeading$6(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    if (FormHeading.access$6(this$0) != null)
    {
      FormHeading.access$6(this$0).dispose();
      FormHeading.access$17(this$0, null);
    }
  }
}

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

import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.internal.forms.IMessageToolTipManager;
import org.eclipse.ui.internal.forms.MessageManager;

class FormHeading$DefaultMessageToolTipManager
  implements IMessageToolTipManager
{
  final FormHeading this$0;
  
  private FormHeading$DefaultMessageToolTipManager(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  FormHeading$DefaultMessageToolTipManager(FormHeading paramFormHeading, DefaultMessageToolTipManager paramDefaultMessageToolTipManager)
  {
    this(paramFormHeading);
  }
  
  public void update()
  {
    String details = this$0.getMessageType() == 0 ? null : 
      MessageManager.createDetails(this$0.getChildrenMessages());
    if (FormHeading.access$0(this$0) != null) {
      FormHeading.access$0(this$0).updateToolTip(details);
    }
    if ((this$0.getMessageType() > 0) && (
      (details == null) || (details.length() == 0))) {
      details = this$0.getMessage();
    }
    FormHeading.access$1(this$0).updateToolTip(details);
  }
  
  public void createToolTip(Control control, boolean imageLabel) {}
}

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

import org.eclipse.jface.action.ToolBarManager;
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.swt.widgets.ToolBar;
import org.eclipse.ui.forms.widgets.ILayoutExtension;
import org.eclipse.ui.forms.widgets.SizeCache;

class FormHeading$FormHeadingLayout
  extends Layout
  implements ILayoutExtension
{
  final FormHeading this$0;
  
  private FormHeading$FormHeadingLayout(FormHeading paramFormHeading)
  {
    this$0 = paramFormHeading;
  }
  
  FormHeading$FormHeadingLayout(FormHeading paramFormHeading, FormHeadingLayout paramFormHeadingLayout)
  {
    this(paramFormHeading);
  }
  
  public int computeMinimumWidth(Composite composite, boolean flushCache)
  {
    return computeSize5-1x;
  }
  
  public int computeMaximumWidth(Composite composite, boolean flushCache)
  {
    return computeSize-1-1x;
  }
  
  public Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache)
  {
    return layout(composite, false, 0, 0, wHint, hHint, flushCache);
  }
  
  protected void layout(Composite composite, boolean flushCache)
  {
    Rectangle rect = composite.getClientArea();
    layout(composite, true, x, y, width, height, 
      flushCache);
  }
  
  private Point layout(Composite composite, boolean move, int x, int y, int width, int height, boolean flushCache)
  {
    Point tsize = null;
    Point msize = null;
    Point tbsize = null;
    Point clsize = null;
    if (flushCache)
    {
      FormHeading.access$2(this$0).flush();
      FormHeading.access$3(this$0).flush();
      FormHeading.access$4(this$0).flush();
    }
    if (FormHeading.access$5(this$0))
    {
      ToolBar tb = FormHead
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