org.eclipse.swt.win32.win32.x86_3.7.2.v3740f

null) {
      name = this$0.stripMnemonic(text);
    }
    result = name;
  }
  
  public void getKeyboardShortcut(AccessibleEvent e)
  {
    String shortcut = null;
    String text = this$0.getAssociatedLabel();
    if (text != null)
    {
      char mnemonic = this$0._findMnemonic(text);
      if (mnemonic != 0) {
        shortcut = "Alt+" + mnemonic;
      }
    }
    result = shortcut;
  }
  
  public void getHelp(AccessibleEvent e)
  {
    result = this$0.getToolTipText();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;

class CCombo$5
  extends AccessibleAdapter
{
  final CCombo this$0;
  
  CCombo$5(CCombo paramCCombo)
  {
    this$0 = paramCCombo;
  }
  
  public void getName(AccessibleEvent e)
  {
    result = (this$0.isDropped() ? SWT.getMessage("SWT_Close") : SWT.getMessage("SWT_Open"));
  }
  
  public void getKeyboardShortcut(AccessibleEvent e)
  {
    result = "Alt+Down Arrow";
  }
  
  public void getHelp(AccessibleEvent e)
  {
    result = this$0.getToolTipText();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.accessibility.AccessibleTextAdapter;
import org.eclipse.swt.accessibility.AccessibleTextEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Text;

class CCombo$6
  extends AccessibleTextAdapter
{
  final CCombo this$0;
  
  CCombo$6(CCombo paramCCombo)
  {
    this$0 = paramCCombo;
  }
  
  public void getCaretOffset(AccessibleTextEvent e)
  {
    offset = this$0.text.getCaretPosition();
  }
  
  public void getSelectionRange(AccessibleTextEvent e)
  {
    Point sel = this$0.text.getSelection();
    offset = x;
    length = (y - x);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.6
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;

class CCombo$7
  extends AccessibleControlAdapter
{
  final CCombo this$0;
  
  CCombo$7(CCombo paramCCombo)
  {
    this$0 = paramCCombo;
  }
  
  public void getChildAtPoint(AccessibleControlEvent e)
  {
    Point testPoint = this$0.toControl(x, y);
    if (this$0.getBounds().contains(testPoint)) {
      childID = -1;
    }
  }
  
  public void getLocation(AccessibleControlEvent e)
  {
    Rectangle location = this$0.getBounds();
    Point pt = this$0.getParent().toDisplay(x, y);
    x = x;
    y = y;
    width = width;
    height = height;
  }
  
  public void getChildCount(AccessibleControlEvent e)
  {
    detail = 0;
  }
  
  public void getRole(AccessibleControlEvent e)
  {
    detail = 46;
  }
  
  public void getState(AccessibleControlEvent e)
  {
    detail = 0;
  }
  
  public void getValue(AccessibleControlEvent e)
  {
    result = this$0.getText();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.7
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.widgets.Text;

class CCombo$8
  extends AccessibleControlAdapter
{
  final CCombo this$0;
  
  CCombo$8(CCombo paramCCombo)
  {
    this$0 = paramCCombo;
  }
  
  public void getRole(AccessibleControlEvent e)
  {
    detail = (this$0.text.getEditable() ? 42 : 41);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.8
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;

class CCombo$9
  extends AccessibleControlAdapter
{
  final CCombo this$0;
  
  CCombo$9(CCombo paramCCombo)
  {
    this$0 = paramCCombo;
  }
  
  public void getDefaultAction(AccessibleControlEvent e)
  {
    result = (this$0.isDropped() ? SWT.getMessage("SWT_Close") : SWT.getMessage("SWT_Open"));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo.9
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleControlAdapter;
import org.eclipse.swt.accessibility.AccessibleControlEvent;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.accessibility.AccessibleTextAdapter;
import org.eclipse.swt.accessibility.AccessibleTextEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TypedListener;

public class CCombo
  extends Composite
{
  Text text;
  List list;
  int visibleItemCount = 5;
  Shell popup;
  Button arrow;
  boolean hasFocus;
  Listener listener;
  Listener filter;
  Color foreground;
  Color background;
  Font font;
  Shell _shell;
  static final String PACKAGE_PREFIX = "org.eclipse.swt.custom.";
  
  public CCombo(Composite parent, int style)
  {
    super(parent, style = checkStyle(style));
    _shell = super.getShell();
    
    int textStyle = 4;
    if ((style & 0x8) != 0) {
      textStyle |= 0x8;
    }
    if ((style & 0x800000) != 0) {
      textStyle |= 0x800000;
    }
    text = new Text(this, textStyle);
    int arrowStyle = 1028;
    if ((style & 0x800000) != 0) {
      arrowStyle |= 0x800000;
    }
    arrow = new Button(this, arrowStyle);
    
    listener = new Listener()
    {
      public void handleEvent(Event event)
      {
        if (isDisposed()) {
          return;
        }
        if (popup == widget)
        {
          popupEvent(event);
          return;
        }
        if (text == widget)
        {
          textEvent(event);
          return;
        }
        if (list == widget)
        {
          listEvent(event);
          return;
        }
        if (arrow == widget)
        {
          arrowEvent(event);
          return;
        }
        if (CCombo.this == widget)
        {
          comboEvent(event);
          return;
        }
        if (getShell() == widget) {
          getDisplay().asyncExec(new CCombo.2(this));
        }
      }
    };
    filter = new Listener()
    {
      public void handleEvent(Event event)
      {
        if (isDisposed()) {
          return;
        }
        if (type == 13)
        {
          if ((widget instanceof ScrollBar)) {
            handleScroll(event);
          }
          return;
        }
        Shell shell = ((Control)widget).getShell();
        if (shell == getShell()) {
          handleFocus(16);
        }
      }
    };
    int[] comboEvents = { 12, 15, 10, 11 };
    for (int i = 0; i < comboEvents.length; i++) {
      addListener(comboEvents[i], listener);
    }
    int[] textEvents = { 14, 29, 1, 2, 35, 24, 
      3, 4, 8, 6, 7, 32, 
      5, 37, 31, 15, 25 };
    for (int i = 0; i < textEvents.length; i++) {
      text.addListener(textEvents[i], listener);
    }
    int[] arrowEvents = { 29, 3, 6, 7, 32, 
      5, 4, 37, 13, 15 };
    for (int i = 0; i < arrowEvents.length; i++) {
      arrow.addListener(arrowEvents[i], listener);
    }
    createPopup(null, -1);
    initAccessible();
  }
  
  static int checkStyle(int style)
  {
    int mask = 109053960;
    return 0x80000 | style & mask;
  }
  
  public void add(String string)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    list.add(string);
  }
  
  public void add(String string, int index)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    list.add(string, index);
  }
  
  public void addModifyListener(ModifyListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    TypedListener typedListener = new TypedListener(listener);
    addListener(24, typedListener);
  }
  
  public void addSelectionListener(SelectionListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    TypedListener typedListener = new TypedListener(listener);
    addListener(13, typedListener);
    addListener(14, typedListener);
  }
  
  public void addVerifyListener(VerifyListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    TypedListener typedListener = new TypedListener(listener);
    addListener(25, typedListener);
  }
  
  void arrowEvent(Event event)
  {
    switch (type)
    {
    case 15: 
      handleFocus(15);
      break;
    case 3: 
    case 4: 
    case 5: 
    case 6: 
    case 7: 
    case 29: 
    case 32: 
      Point pt = getDisplay().map(arrow, this, x, y);
      x = x;y = y;
      notifyListeners(type, event);
      type = 0;
      break;
    case 37: 
      Point pt = getDisplay().map(arrow, this, x, y);
      x = x;y = y;
      notifyListeners(37, event);
      type = 0;
      if ((!isDisposed()) && 
        (doit) && 
        (count != 0))
      {
        doit = false;
        int oldIndex = getSelectionIndex();
        if (count > 0) {
          select(Math.max(oldIndex - 1, 0));
        } else {
          select(Math.min(oldIndex + 1, getItemCount() - 1));
        }
        if (oldIndex != getSelectionIndex())
        {
          Event e = new Event();
          time = time;
          stateMask = stateMask;
          notifyListeners(13, e);
        }
        if (!isDisposed()) {
          break;
        }
      }
      break;
    case 13: 
      text.setFocus();
      dropDown(!isDropped());
    }
  }
  
  protected void checkSubclass()
  {
    String name = getClass().getName();
    int index = name.lastIndexOf('.');
    if (!name.substring(0, index + 1).equals("org.eclipse.swt.custom.")) {
      SWT.error(43);
    }
  }
  
  public void clearSelection()
  {
    checkWidget();
    text.clearSelection();
    list.deselectAll();
  }
  
  void comboEvent(Event event)
  {
    switch (type)
    {
    case 12: 
      removeListener(12, listener);
      notifyListeners(12, event);
      type = 0;
      if ((popup != null) && (!popup.isDisposed()))
      {
        list.removeListener(12, listener);
        popup.dispose();
      }
      Shell shell = getShell();
      shell.removeListener(27, listener);
      Display display = getDisplay();
      display.removeFilter(15, filter);
      popup = null;
      text = null;
      list = null;
      arrow = null;
      _shell = null;
      break;
    case 15: 
      Control focusControl = getDisplay().getFocusControl();
      if ((focusControl == arrow) || (focusControl == list)) {
        return;
      }
      if (isDropped()) {
        list.setFocus();
      } else {
        text.setFocus();
      }
      break;
    case 10: 
      dropDown(false);
      break;
    case 11: 
      internalLayout(false);
    }
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    checkWidget();
    int width = 0;int height = 0;
    String[] items = list.getItems();
    GC gc = new GC(text);
    int spacer = stringExtent" "x;
    int textWidth = stringExtenttext.getText()).x;
    for (int i = 0; i < items.length; i++) {
      textWidth = Math.max(stringExtentx, textWidth);
    }
    gc.dispose();
    Point textSize = text.computeSize(-1, -1, changed);
    Point arrowSize = arrow.computeSize(-1, -1, changed);
    Point listSize = list.computeSize(-1, -1, changed);
    int borderWidth = getBorderWidth();
    
    height = Math.max(y, y);
    width = Math.max(textWidth + 2 * spacer + x + 2 * borderWidth, x);
    if (wHint != -1) {
      width = wHint;
    }
    if (hHint != -1) {
      height = hHint;
    }
    return new Point(width + 2 * borderWidth, height + 2 * borderWidth);
  }
  
  public void copy()
  {
    checkWidget();
    text.copy();
  }
  
  void createPopup(String[] items, int selectionIndex)
  {
    popup = new Shell(getShell(), 16392);
    int style = getStyle();
    int listStyle = 516;
    if ((style & 0x800000) != 0) {
      listStyle |= 0x800000;
    }
    if ((style & 0x4000000) != 0) {
      listStyle |= 0x4000000;
    }
    if ((style & 0x2000000) != 0) {
      listStyle |= 0x2000000;
    }
    list = new List(popup, listStyle);
    if (font != null) {
      list.setFont(font);
    }
    if (foreground != null) {
      list.setForeground(foreground);
    }
    if (background != null) {
      list.setBackground(background);
    }
    int[] popupEvents = { 21, 9 };
    for (int i = 0; i < popupEvents.length; i++) {
      popup.addListener(popupEvents[i], listener);
    }
    int[] listEvents = { 4, 13, 31, 1, 2, 15, 16, 12 };
    for (int i = 0; i < listEvents.length; i++) {
      list.addListener(listEvents[i], listener);
    }
    if (items != null) {
      list.setItems(items);
    }
    if (selectionIndex != -1) {
      list.setSelection(selectionIndex);
    }
  }
  
  public void cut()
  {
    checkWidget();
    text.cut();
  }
  
  public void deselect(int index)
  {
    checkWidget();
    if ((index >= 0) && (index < list.getItemCount()) && 
      (index == list.getSelectionIndex()) && 
      (text.getText().equals(list.getItem(index))))
    {
      text.setText("");
      list.deselect(index);
    }
  }
  
  public void deselectAll()
  {
    checkWidget();
    text.setText("");
    list.deselectAll();
  }
  
  void dropDown(boolean drop)
  {
    if (drop == isDropped()) {
      return;
    }
    Display display = getDisplay();
    if (!drop)
    {
      display.removeFilter(13, filter);
      popup.setVisible(false);
      if ((!isDisposed()) && (isFocusControl())) {
        text.setFocus();
      }
      return;
    }
    if (!isVisible()) {
      return;
    }
    if (getShell() != popup.getParent())
    {
      String[] items = list.getItems();
      int selectionIndex = list.getSelectionIndex();
      list.removeListener(12, listener);
      popup.dispose();
      popup = null;
      list = null;
      createPopup(items, selectionIndex);
    }
    Point size = getSize();
    int itemCount = list.getItemCount();
    itemCount = itemCount == 0 ? visibleItemCount : Math.min(visibleItemCount, itemCount);
    int itemHeight = list.getItemHeight() * itemCount;
    Point listSize = list.computeSize(-1, itemHeight, false);
    list.setBounds(1, 1, Math.max(x - 2, x), y);
    
    int index = list.getSelectionIndex();
    if (index != -1) {
      list.setTopIndex(index);
    }
    Rectangle listRect = list.getBounds();
    Rectangle parentRect = display.map(getParent(), null, getBounds());
    Point comboSize = getSize();
    Rectangle displayRect = getMonitor().getClientArea();
    int width = Math.max(x, width + 2);
    int height = height + 2;
    int x = x;
    int y = y + y;
    if (y + height > y + height) {
      y = y - height;
    }
    if (x + width > x + width) {
      x = x + width - width;
    }
    popup.setBounds(x, y, width, height);
    popup.setVisible(true);
    if (isFocusControl()) {
      list.setFocus();
    }
    display.removeFilter(13, filter);
    display.addFilter(13, filter);
  }
  
  char _findMnemonic(String string)
  {
    if (string == null) {
      return '\000';
    }
    int index = 0;
    int length = string.length();
    do
    {
      while ((index < length) && (string.charAt(index) != '&')) {
        index++;
      }
      index++;
      if (index >= length) {
        return '\000';
      }
      if (string.charAt(index) != '&') {
        return Character.toLowerCase(string.charAt(index));
      }
      index++;
    } while (index < length);
    return '\000';
  }
  
  String getAssociatedLabel()
  {
    Control[] siblings = getParent().getChildren();
    for (int i = 0; i < siblings.length; i++) {
      if (siblings[i] == this)
      {
        if (i <= 0) {
          break;
        }
        Control sibling = siblings[(i - 1)];
        if ((sibling instanceof Label)) {
          return ((Label)sibling).getText();
        }
        if (!(sibling instanceof CLabel)) {
          break;
        }
        return ((CLabel)sibling).getText();
      }
    }
    return null;
  }
  
  public Control[] getChildren()
  {
    checkWidget();
    return new Control[0];
  }
  
  public boolean getEditable()
  {
    checkWidget();
    return text.getEditable();
  }
  
  public String getItem(int index)
  {
    checkWidget();
    return list.getItem(index);
  }
  
  public int getItemCount()
  {
    checkWidget();
    return list.getItemCount();
  }
  
  public int getItemHeight()
  {
    checkWidget();
    return list.getItemHeight();
  }
  
  public String[] getItems()
  {
    checkWidget();
    return list.getItems();
  }
  
  public boolean getListVisible()
  {
    checkWidget();
    return isDropped();
  }
  
  public Menu getMenu()
  {
    return text.getMenu();
  }
  
  public Point getSelection()
  {
    checkWidget();
    return text.getSelection();
  }
  
  public int getSelectionIndex()
  {
    checkWidget();
    return list.getSelectionIndex();
  }
  
  public Shell getShell()
  {
    checkWidget();
    Shell shell = super.getShell();
    if (shell != _shell)
    {
      if ((_shell != null) && (!_shell.isDisposed())) {
        _shell.removeListener(27, listener);
      }
      _shell = shell;
    }
    return _shell;
  }
  
  public int getStyle()
  {
    int style = super.getStyle();
    style &= 0xFFFFFFF7;
    if (!text.getEditable()) {
      style |= 0x8;
    }
    return style;
  }
  
  public String getText()
  {
    checkWidget();
    return text.getText();
  }
  
  public int getTextHeight()
  {
    checkWidget();
    return text.getLineHeight();
  }
  
  public int getTextLimit()
  {
    checkWidget();
    return text.getTextLimit();
  }
  
  public int getVisibleItemCount()
  {
    checkWidget();
    return visibleItemCount;
  }
  
  void handleFocus(int type)
  {
    switch (type)
    {
    case 15: 
      if (hasFocus) {
        return;
      }
      if (getEditable()) {
        text.selectAll();
      }
      hasFocus = true;
      Shell shell = getShell();
      shell.removeListener(27, listener);
      shell.addListener(27, listener);
      Display display = getDisplay();
      display.removeFilter(15, filter);
      display.addFilter(15, filter);
      Event e = new Event();
      notifyListeners(15, e);
      break;
    case 16: 
      if (!hasFocus) {
        return;
      }
      Control focusControl = getDisplay().getFocusControl();
      if ((focusControl == arrow) || (focusControl == list) || (focusControl == text)) {
        return;
      }
      hasFocus = false;
      Shell shell = getShell();
      shell.removeListener(27, listener);
      Display display = getDisplay();
      display.removeFilter(15, filter);
      Event e = new Event();
      notifyListeners(16, e);
    }
  }
  
  void handleScroll(Event event)
  {
    ScrollBar scrollBar = (ScrollBar)widget;
    Control scrollableParent = scrollBar.getParent();
    if (scrollableParent.equals(list)) {
      return;
    }
    if (isParentScrolling(scrollableParent)) {
      dropDown(false);
    }
  }
  
  public int indexOf(String string)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    return list.indexOf(string);
  }
  
  public int indexOf(String string, int start)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    return list.indexOf(string, start);
  }
  
  void initAccessible()
  {
    AccessibleAdapter accessibleAdapter = new AccessibleAdapter()
    {
      public void getName(AccessibleEvent e)
      {
        String name = null;
        String text = getAssociatedLabel();
        if (text != null) {
          name = stripMnemonic(text);
        }
        result = name;
      }
      
      public void getKeyboardShortcut(AccessibleEvent e)
      {
        String shortcut = null;
        String text = getAssociatedLabel();
        if (text != null)
        {
          char mnemonic = _findMnemonic(text);
          if (mnemonic != 0) {
            shortcut = "Alt+" + mnemonic;
          }
        }
        result = shortcut;
      }
      
      public void getHelp(AccessibleEvent e)
      {
        result = getToolTipText();
      }
    };
    getAccessible().addAccessibleListener(accessibleAdapter);
    text.getAccessible().addAccessibleListener(accessibleAdapter);
    list.getAccessible().addAccessibleListener(accessibleAdapter);
    
    arrow.getAccessible().addAccessibleListener(new AccessibleAdapter()
    {
      public void getName(AccessibleEvent e)
      {
        result = (isDropped() ? SWT.getMessage("SWT_Close") : SWT.getMessage("SWT_Open"));
      }
      
      public void getKeyboardShortcut(AccessibleEvent e)
      {
        result = "Alt+Down Arrow";
      }
      
      public void getHelp(AccessibleEvent e)
      {
        result = getToolTipText();
      }
    });
    getAccessible().addAccessibleTextListener(new AccessibleTextAdapter()
    {
      public void getCaretOffset(AccessibleTextEvent e)
      {
        offset = text.getCaretPosition();
      }
      
      public void getSelectionRange(AccessibleTextEvent e)
      {
        Point sel = text.getSelection();
        offset = x;
        length = (y - x);
      }
    });
    getAccessible().addAccessibleControlListener(new AccessibleControlAdapter()
    {
      public void getChildAtPoint(AccessibleControlEvent e)
      {
        Point testPoint = toControl(x, y);
        if (getBounds().contains(testPoint)) {
          childID = -1;
        }
      }
      
      public void getLocation(AccessibleControlEvent e)
      {
        Rectangle location = getBounds();
        Point pt = getParent().toDisplay(x, y);
        x = x;
        y = y;
        width = width;
        height = height;
      }
      
      public void getChildCount(AccessibleControlEvent e)
      {
        detail = 0;
      }
      
      public void getRole(AccessibleControlEvent e)
      {
        detail = 46;
      }
      
      public void getState(AccessibleControlEvent e)
      {
        detail = 0;
      }
      
      public void getValue(AccessibleControlEvent e)
      {
        result = getText();
      }
    });
    text.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter()
    {
      public void getRole(AccessibleControlEvent e)
      {
        detail = (text.getEditable() ? 42 : 41);
      }
    });
    arrow.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter()
    {
      public void getDefaultAction(AccessibleControlEvent e)
      {
        result = (isDropped() ? SWT.getMessage("SWT_Close") : SWT.getMessage("SWT_Open"));
      }
    });
  }
  
  boolean isDropped()
  {
    return popup.getVisible();
  }
  
  public boolean isFocusControl()
  {
    checkWidget();
    if ((text.isFocusControl()) || (arrow.isFocusControl()) || (list.isFocusControl()) || (popup.isFocusControl())) {
      return true;
    }
    return super.isFocusControl();
  }
  
  boolean isParentScrolling(Control scrollableParent)
  {
    Control parent = getParent();
    while (parent != null)
    {
      if (parent.equals(scrollableParent)) {
        return true;
      }
      parent = parent.getParent();
    }
    return false;
  }
  
  void internalLayout(boolean changed)
  {
    if (isDropped()) {
      dropDown(false);
    }
    Rectangle rect = getClientArea();
    int width = width;
    int height = height;
    Point arrowSize = arrow.computeSize(-1, height, changed);
    text.setBounds(0, 0, width - x, height);
    arrow.setBounds(width - x, 0, x, y);
  }
  
  void listEvent(Event event)
  {
    switch (type)
    {
    case 12: 
      if (getShell() != popup.getParent())
      {
        String[] items = list.getItems();
        int selectionIndex = list.getSelectionIndex();
        popup = null;
        list = null;
        createPopup(items, selectionIndex);
      }
      break;
    case 15: 
      handleFocus(15);
      break;
    case 16: 
      if (!"carbon".equals(SWT.getPlatform()))
      {
        Point point = arrow.toControl(getDisplay().getCursorLocation());
        Point size = arrow.getSize();
        Rectangle rect = new Rectangle(0, 0, x, y);
        if (rect.contains(point))
        {
          boolean comboShellActivated = getDisplay().getActiveShell() == getShell();
          if (comboShellActivated) {
            break;
          }
          dropDown(false);
          break;
        }
      }
      dropDown(false);
      break;
    case 4: 
      if (button != 1) {
        return;
      }
      dropDown(false);
      break;
    case 13: 
      int index = list.getSelectionIndex();
      if (index == -1) {
        return;
      }
      text.setText(list.getItem(index));
      text.selectAll();
      list.setSelection(index);
      Event e = new Event();
      time = time;
      stateMask = stateMask;
      doit = doit;
      notifyListeners(13, e);
      doit = doit;
      break;
    case 31: 
      switch (detail)
      {
      case 2: 
      case 4: 
      case 32: 
      case 64: 
        doit = false;
        break;
      case 8: 
      case 16: 
        doit = text.traverse(detail);
        detail = 0;
        if (doit) {
          dropDown(false);
        }
        return;
      }
      Event e = new Event();
      time = time;
      detail = detail;
      doit = doit;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      notifyListeners(31, e);
      doit = doit;
      detail = detail;
      break;
    case 2: 
      Event e = new Event();
      time = time;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      stateMask = stateMask;
      notifyListeners(2, e);
      doit = doit;
      break;
    case 1: 
      if (character == '\033') {
        dropDown(false);
      }
      if (((stateMask & 0x10000) != 0) && ((keyCode == 16777217) || (keyCode == 16777218))) {
        dropDown(false);
      }
      if (character == '\r')
      {
        dropDown(false);
        Event e = new Event();
        time = time;
        stateMask = stateMask;
        notifyListeners(14, e);
      }
      if (!isDisposed())
      {
        Event e = new Event();
        time = time;
        character = character;
        keyCode = keyCode;
        keyLocation = keyLocation;
        stateMask = stateMask;
        notifyListeners(1, e);
        doit = doit;
      }
      break;
    }
  }
  
  public void paste()
  {
    checkWidget();
    text.paste();
  }
  
  void popupEvent(Event event)
  {
    switch (type)
    {
    case 9: 
      Rectangle listRect = list.getBounds();
      Color black = getDisplay().getSystemColor(2);
      gc.setForeground(black);
      gc.drawRectangle(0, 0, width + 1, height + 1);
      break;
    case 21: 
      doit = false;
      dropDown(false);
    }
  }
  
  public void redraw()
  {
    super.redraw();
    text.redraw();
    arrow.redraw();
    if (popup.isVisible()) {
      list.redraw();
    }
  }
  
  public void redraw(int x, int y, int width, int height, boolean all)
  {
    super.redraw(x, y, width, height, true);
  }
  
  public void remove(int index)
  {
    checkWidget();
    list.remove(index);
  }
  
  public void remove(int start, int end)
  {
    checkWidget();
    list.remove(start, end);
  }
  
  public void remove(String string)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    list.remove(string);
  }
  
  public void removeAll()
  {
    checkWidget();
    text.setText("");
    list.removeAll();
  }
  
  public void removeModifyListener(ModifyListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    removeListener(24, listener);
  }
  
  public void removeSelectionListener(SelectionListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    removeListener(13, listener);
    removeListener(14, listener);
  }
  
  public void removeVerifyListener(VerifyListener listener)
  {
    checkWidget();
    if (listener == null) {
      SWT.error(4);
    }
    removeListener(25, listener);
  }
  
  public void select(int index)
  {
    checkWidget();
    if (index == -1)
    {
      list.deselectAll();
      text.setText("");
      return;
    }
    if ((index >= 0) && (index < list.getItemCount()) && 
      (index != getSelectionIndex()))
    {
      text.setText(list.getItem(index));
      text.selectAll();
      list.select(index);
      list.showSelection();
    }
  }
  
  public void setBackground(Color color)
  {
    super.setBackground(color);
    background = color;
    if (text != null) {
      text.setBackground(color);
    }
    if (list != null) {
      list.setBackground(color);
    }
    if (arrow != null) {
      arrow.setBackground(color);
    }
  }
  
  public void setEditable(boolean editable)
  {
    checkWidget();
    text.setEditable(editable);
  }
  
  public void setEnabled(boolean enabled)
  {
    super.setEnabled(enabled);
    if (popup != null) {
      popup.setVisible(false);
    }
    if (text != null) {
      text.setEnabled(enabled);
    }
    if (arrow != null) {
      arrow.setEnabled(enabled);
    }
  }
  
  public boolean setFocus()
  {
    checkWidget();
    if ((!isEnabled()) || (!getVisible())) {
      return false;
    }
    if (isFocusControl()) {
      return true;
    }
    return text.setFocus();
  }
  
  public void setFont(Font font)
  {
    super.setFont(font);
    this.font = font;
    text.setFont(font);
    list.setFont(font);
    internalLayout(true);
  }
  
  public void setForeground(Color color)
  {
    super.setForeground(color);
    foreground = color;
    if (text != null) {
      text.setForeground(color);
    }
    if (list != null) {
      list.setForeground(color);
    }
    if (arrow != null) {
      arrow.setForeground(color);
    }
  }
  
  public void setItem(int index, String string)
  {
    checkWidget();
    list.setItem(index, string);
  }
  
  public void setItems(String[] items)
  {
    checkWidget();
    list.setItems(items);
    if (!text.getEditable()) {
      text.setText("");
    }
  }
  
  public void setLayout(Layout layout)
  {
    checkWidget();
  }
  
  public void setListVisible(boolean visible)
  {
    checkWidget();
    dropDown(visible);
  }
  
  public void setMenu(Menu menu)
  {
    text.setMenu(menu);
  }
  
  public void setSelection(Point selection)
  {
    checkWidget();
    if (selection == null) {
      SWT.error(4);
    }
    text.setSelection(x, y);
  }
  
  public void setText(String string)
  {
    checkWidget();
    if (string == null) {
      SWT.error(4);
    }
    int index = list.indexOf(string);
    if (index == -1)
    {
      list.deselectAll();
      text.setText(string);
      return;
    }
    text.setText(string);
    text.selectAll();
    list.setSelection(index);
    list.showSelection();
  }
  
  public void setTextLimit(int limit)
  {
    checkWidget();
    text.setTextLimit(limit);
  }
  
  public void setToolTipText(String string)
  {
    checkWidget();
    super.setToolTipText(string);
    arrow.setToolTipText(string);
    text.setToolTipText(string);
  }
  
  public void setVisible(boolean visible)
  {
    super.setVisible(visible);
    if (isDisposed()) {
      return;
    }
    if ((popup == null) || (popup.isDisposed())) {
      return;
    }
    if (!visible) {
      popup.setVisible(false);
    }
  }
  
  public void setVisibleItemCount(int count)
  {
    checkWidget();
    if (count < 0) {
      return;
    }
    visibleItemCount = count;
  }
  
  String stripMnemonic(String string)
  {
    int index = 0;
    int length = string.length();
    do
    {
      while ((index < length) && (string.charAt(index) != '&')) {
        index++;
      }
      index++;
      if (index >= length) {
        return string;
      }
      if (string.charAt(index) != '&') {
        return string.substring(0, index - 1) + string.substring(index, length);
      }
      index++;
    } while (index < length);
    return string;
  }
  
  void textEvent(Event event)
  {
    switch (type)
    {
    case 15: 
      handleFocus(15);
      break;
    case 14: 
      dropDown(false);
      Event e = new Event();
      time = time;
      stateMask = stateMask;
      notifyListeners(14, e);
      break;
    case 5: 
    case 6: 
    case 7: 
    case 8: 
    case 29: 
    case 32: 
      Point pt = getDisplay().map(text, this, x, y);
      x = x;y = y;
      notifyListeners(type, event);
      type = 0;
      break;
    case 1: 
      Event keyEvent = new Event();
      time = time;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      stateMask = stateMask;
      notifyListeners(1, keyEvent);
      if (!isDisposed())
      {
        doit = doit;
        if ((doit) && (
          (keyCode == 16777217) || (keyCode == 16777218)))
        {
          doit = false;
          if ((stateMask & 0x10000) != 0)
          {
            boolean dropped = isDropped();
            text.selectAll();
            if (!dropped) {
              setFocus();
            }
            dropDown(!dropped);
          }
          else
          {
            int oldIndex = getSelectionIndex();
            if (keyCode == 16777217) {
              select(Math.max(oldIndex - 1, 0));
            } else {
              select(Math.min(oldIndex + 1, getItemCount() - 1));
            }
            if (oldIndex != getSelectionIndex())
            {
              Event e = new Event();
              time = time;
              stateMask = stateMask;
              notifyListeners(13, e);
            }
            if (!isDisposed()) {
              break;
            }
          }
        }
      }
      break;
    case 2: 
      Event e = new Event();
      time = time;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      stateMask = stateMask;
      notifyListeners(2, e);
      doit = doit;
      break;
    case 35: 
      Event e = new Event();
      time = time;
      notifyListeners(35, e);
      break;
    case 24: 
      list.deselectAll();
      Event e = new Event();
      time = time;
      notifyListeners(24, e);
      break;
    case 3: 
      Point pt = getDisplay().map(text, this, x, y);
      Event mouseEvent = new Event();
      button = button;
      count = count;
      stateMask = stateMask;
      time = time;
      x = x;y = y;
      notifyListeners(3, mouseEvent);
      if (!isDisposed())
      {
        doit = doit;
        if (doit)
        {
          if (button != 1) {
            return;
          }
          if (text.getEditable()) {
            return;
          }
          boolean dropped = isDropped();
          text.selectAll();
          if (!dropped) {
            setFocus();
          }
          dropDown(!dropped);
        }
      }
      break;
    case 4: 
      Point pt = getDisplay().map(text, this, x, y);
      Event mouseEvent = new Event();
      button = button;
      count = count;
      stateMask = stateMask;
      time = time;
      x = x;y = y;
      notifyListeners(4, mouseEvent);
      if (!isDisposed())
      {
        doit = doit;
        if (doit)
        {
          if (button != 1) {
            return;
          }
          if (text.getEditable()) {
            return;
          }
          text.selectAll();
        }
      }
      break;
    case 37: 
      notifyListeners(37, event);
      type = 0;
      if ((!isDisposed()) && 
        (doit) && 
        (count != 0))
      {
        doit = false;
        int oldIndex = getSelectionIndex();
        if (count > 0) {
          select(Math.max(oldIndex - 1, 0));
        } else {
          select(Math.min(oldIndex + 1, getItemCount() - 1));
        }
        if (oldIndex != getSelectionIndex())
        {
          Event e = new Event();
          time = time;
          stateMask = stateMask;
          notifyListeners(13, e);
        }
        if (!isDisposed()) {
          break;
        }
      }
      break;
    case 31: 
      switch (detail)
      {
      case 32: 
      case 64: 
        doit = false;
        break;
      case 8: 
        doit = traverse(8);
        detail = 0;
        return;
      }
      Event e = new Event();
      time = time;
      detail = detail;
      doit = doit;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      notifyListeners(31, e);
      doit = doit;
      detail = detail;
      break;
    case 25: 
      Event e = new Event();
      text = text;
      start = start;
      end = end;
      character = character;
      keyCode = keyCode;
      keyLocation = keyLocation;
      stateMask = stateMask;
      notifyListeners(25, e);
      text = text;
      doit = doit;
    }
  }
  
  public boolean traverse(int event)
  {
    if ((event == 64) || (event == 16)) {
      return text.traverse(event);
    }
    return super.traverse(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CCombo
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

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

class CLabel$1
  implements PaintListener
{
  final CLabel this$0;
  
  CLabel$1(CLabel paramCLabel)
  {
    this$0 = paramCLabel;
  }
  
  public void paintControl(PaintEvent event)
  {
    this$0.onPaint(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CLabel.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;

class CLabel$2
  implements TraverseListener
{
  final CLabel this$0;
  
  CLabel$2(CLabel paramCLabel)
  {
    this$0 = paramCLabel;
  }
  
  public void keyTraversed(TraverseEvent event)
  {
    if (detail == 128) {
      this$0.onMnemonic(event);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CLabel.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

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

class CLabel$3
  implements Listener
{
  final CLabel this$0;
  
  CLabel$3(CLabel paramCLabel)
  {
    this$0 = paramCLabel;
  }
  
  public void handleEvent(Event event)
  {
    this$0.onDispose(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.custom.CLabel.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.custom;

import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;

class CLabel$4
  ex
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146

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-2017. Infinite Loop Ltd