|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2008 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 836-848
Link Here
|
| 836 |
if (next) { |
836 |
if (next) { |
| 837 |
for (int j = i + 1; j < children.length; j++) { |
837 |
for (int j = i + 1; j < children.length; j++) { |
| 838 |
Control nc = children[j]; |
838 |
Control nc = children[j]; |
| 839 |
if (nc.setFocus()) |
839 |
if (doFocusSibling(nc)) |
| 840 |
return false; |
840 |
return false; |
| 841 |
} |
841 |
} |
| 842 |
} else { |
842 |
} else { |
| 843 |
for (int j = i - 1; j >= 0; j--) { |
843 |
for (int j = i - 1; j >= 0; j--) { |
| 844 |
Control pc = children[j]; |
844 |
Control pc = children[j]; |
| 845 |
if (pc.setFocus()) |
845 |
if (doFocusSibling(pc)) |
| 846 |
return false; |
846 |
return false; |
| 847 |
} |
847 |
} |
| 848 |
} |
848 |
} |
|
Lines 850-855
Link Here
|
| 850 |
} |
850 |
} |
| 851 |
return false; |
851 |
return false; |
| 852 |
} |
852 |
} |
|
|
853 |
|
| 854 |
private boolean doFocusSibling(Control control) { |
| 855 |
if (!(control instanceof FormText)) |
| 856 |
return control.setFocus(); |
| 857 |
return ((FormText) control).setFocusProgramatic(); |
| 858 |
} |
| 853 |
|
859 |
|
| 854 |
/** |
860 |
/** |
| 855 |
* Controls whether whitespace inside paragraph and list items is |
861 |
* Controls whether whitespace inside paragraph and list items is |
|
Lines 1702-1707
Link Here
|
| 1702 |
* @see org.eclipse.swt.widgets.Control#setFocus() |
1708 |
* @see org.eclipse.swt.widgets.Control#setFocus() |
| 1703 |
*/ |
1709 |
*/ |
| 1704 |
public boolean setFocus() { |
1710 |
public boolean setFocus() { |
|
|
1711 |
mouseFocus = true; |
| 1712 |
boolean result = setFocusProgramatic(); |
| 1713 |
mouseFocus = false; |
| 1714 |
return result; |
| 1715 |
} |
| 1716 |
|
| 1717 |
boolean setFocusProgramatic() { |
| 1705 |
FormUtil.setFocusScrollingEnabled(this, false); |
1718 |
FormUtil.setFocusScrollingEnabled(this, false); |
| 1706 |
boolean result = super.setFocus(); |
1719 |
boolean result = super.setFocus(); |
| 1707 |
FormUtil.setFocusScrollingEnabled(this, true); |
1720 |
FormUtil.setFocusScrollingEnabled(this, true); |