Bug 509089 - Remove trailing whitespace from org.eclipse.swt.examples
Change-Id: Iebaa081db41da7ae2e6736fbf3e0a736ab5ee1e1
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs
index 5b25dc1..0965ff6 100644
--- a/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs
+++ b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs
@@ -35,7 +35,7 @@
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_type_arguments=true
-sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleBarChartExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleBarChartExample.java
index caaec0a..8d4c353 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleBarChartExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleBarChartExample.java
@@ -23,12 +23,12 @@
public class AccessibleBarChartExample {
static Display display;
static Shell shell;
-
+
public static void main(String[] args) {
display = new Display();
shell = new Shell(display);
shell.setLayout(new GridLayout());
-
+
BarChart pets = new BarChart(shell, SWT.BORDER);
pets.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
pets.setTitle("Kids in my class: Pet Survey");
@@ -38,7 +38,7 @@
pets.addData("Budgies", 1);
pets.addData("Fish", 4);
pets.addData("None", 4);
-
+
BarChart foods = new BarChart(shell, SWT.BORDER);
foods.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
foods.setTitle("Kids in my class: Favorite Food Survey");
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleNameExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleNameExample.java
index aa29313..0df9fbd 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleNameExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleNameExample.java
@@ -27,10 +27,10 @@
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
shell.setText("Accessible Name");
-
+
Button button = new Button(shell, SWT.PUSH);
button.setText("Button"); // the first button's accessible name is "Button"
-
+
Image image = new Image(display, AccessibleNameExample.class.getResourceAsStream("run.gif"));
button = new Button(shell, SWT.PUSH);
button.setImage(image);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleShapesExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleShapesExample.java
index 6bc24f9..5e0db87 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleShapesExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleShapesExample.java
@@ -22,16 +22,16 @@
public class AccessibleShapesExample {
static Display display;
static Shell shell;
-
+
public static void main(String[] args) {
display = new Display();
shell = new Shell(display);
shell.setLayout(new FillLayout());
-
+
Shape redSquare = new Shape(shell, SWT.NONE);
redSquare.setColor(SWT.COLOR_RED);
redSquare.setShape(Shape.SQUARE);
-
+
Shape blueCircle = new Shape(shell, SWT.NONE);
blueCircle.setColor(SWT.COLOR_BLUE);
blueCircle.setShape(Shape.CIRCLE);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleTableExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleTableExample.java
index 9dac6ae..266bac5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleTableExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleTableExample.java
@@ -25,7 +25,7 @@
public class AccessibleTableExample {
static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_accessibility"); //$NON-NLS-1$
static CTable table1;
-
+
static String getResourceString(String key) {
try {
return resourceBundle.getString(key);
@@ -33,7 +33,7 @@
return key;
} catch (NullPointerException e) {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
+ }
}
static final String [] itemText = new String [] {
AccessibleTableExample.getResourceString("color1"),
@@ -47,13 +47,13 @@
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
shell.setText("Accessible Table Example");
-
+
Group group = new Group(shell, SWT.NONE);
group.setText("Tables With Accessible Cell Children");
group.setLayout(new GridLayout());
new Label(group, SWT.NONE).setText("CTable with column headers");
-
+
table1 = new CTable(group, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
table1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
table1.setHeaderVisible(true);
@@ -67,7 +67,7 @@
CTableItem item = new CTableItem(table1, SWT.NONE);
item.setText(new String [] {"C0R" + row, "C1R" + row, "C2R" + row});
}
-
+
Composite btnGroup = new Composite(group, SWT.NONE);
btnGroup.setLayout(new FillLayout(SWT.VERTICAL));
Button btn = new Button(btnGroup, SWT.PUSH);
@@ -79,7 +79,7 @@
int colCount = table1.getColumnCount();
CTableItem item = new CTableItem(table1, SWT.NONE);
String[] cells = new String[colCount];
-
+
for (int i = 0; i < colCount; i++) {
cells[i] = "C" + i + "R" + currSize;
}
@@ -125,16 +125,16 @@
@Override
public void widgetSelected(SelectionEvent e) {
int colCount = table1.getColumnCount();
-
+
if (colCount > 0) {
CTableColumn column = table1.getColumn(colCount - 1);
column.dispose();
}
}
});
-
+
new Label(group, SWT.NONE).setText("CTable used as a list");
-
+
CTable table2 = new CTable(group, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
table2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
table2.setLinesVisible(true);
@@ -142,7 +142,7 @@
CTableItem item = new CTableItem(table2, SWT.NONE);
item.setText(itemText[row]);
}
-
+
shell.pack();
shell.open();
while (!shell.isDisposed()) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
index 539da19..c03e13e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
@@ -45,7 +45,7 @@
import org.eclipse.swt.widgets.TypedListener;
import org.eclipse.swt.widgets.Widget;
-/**
+/**
* Instances of this class implement a selectable user interface
* object that displays a list of images and strings and issues
* notification when selected.
@@ -70,7 +70,7 @@
* item.setText ("Item " + index);
* System.out.println (item.getText ());
* }
- * });
+ * });
* </pre></code>
* </p><p>
* Note that although this class is a subclass of <code>Composite</code>,
@@ -135,7 +135,7 @@
static final String ID_CHECKMARK = "CHECKMARK"; //$NON-NLS-1$
static final String ID_ARROWUP = "ARROWUP"; //$NON-NLS-1$
static final String ID_ARROWDOWN = "ARROWDOWN"; //$NON-NLS-1$
-
+
Display display;
//TEMPORARY CODE
@@ -144,14 +144,14 @@
public boolean isFocusControl() {
return hasFocus;
}
-
+
/**
* Constructs a new instance of this class given its parent
* and a style value describing its behavior and appearance.
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
+ * class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
@@ -192,19 +192,19 @@
checkboxBounds = getUncheckedImage ().getBounds ();
arrowBounds = getArrowDownImage ().getBounds ();
clientArea = getClientArea ();
-
+
Listener listener = event -> handleEvents (event);
addListener (SWT.Paint, listener);
addListener (SWT.MouseDown, listener);
addListener (SWT.MouseUp, listener);
addListener (SWT.MouseDoubleClick, listener);
- addListener (SWT.Dispose, listener);
+ addListener (SWT.Dispose, listener);
addListener (SWT.Resize, listener);
addListener (SWT.KeyDown, listener);
addListener (SWT.FocusOut, listener);
addListener (SWT.FocusIn, listener);
addListener (SWT.Traverse, listener);
-
+
initAccessibility ();
header = new Canvas (this, SWT.NO_REDRAW_RESIZE | SWT.NO_FOCUS);
@@ -275,7 +275,7 @@
public void addSelectionListener (SelectionListener listener) {
checkWidget ();
if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener (listener);
+ TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection, typedListener);
addListener (SWT.DefaultSelection, typedListener);
}
@@ -298,7 +298,7 @@
* WS_VSCROLL is not specified, Windows creates
* trees and tables with scroll bars. The fix
* is to set H_SCROLL and V_SCROLL.
- *
+ *
* NOTE: This code appears on all platforms so that
* applications have consistent scroll bar behavior.
*/
@@ -336,10 +336,10 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see SWT#VIRTUAL
* @see SWT#SetData
- *
+ *
* @since 3.0
*/
public void clear (int index) {
@@ -368,10 +368,10 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see SWT#VIRTUAL
* @see SWT#SetData
- *
+ *
* @since 3.0
*/
public void clear (int start, int end) {
@@ -402,10 +402,10 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see SWT#VIRTUAL
* @see SWT#SetData
- *
+ *
* @since 3.0
*/
public void clear (int [] indices) {
@@ -417,7 +417,7 @@
SWT.error (SWT.ERROR_INVALID_RANGE);
}
}
-
+
for (int i = 0; i < indices.length; i++) {
items [indices [i]].clear ();
}
@@ -436,10 +436,10 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see SWT#VIRTUAL
* @see SWT#SetData
- *
+ *
* @since 3.0
*/
public void clearAll () {
@@ -492,7 +492,7 @@
newColumns [index] = column;
System.arraycopy (columns, index, newColumns, index + 1, columns.length - index);
columns = newColumns;
-
+
if (orderedColumns != null) {
int insertIndex = 0;
if (index > 0) {
@@ -524,7 +524,7 @@
redrawFromItemDownwards (topIndex);
}
}
-
+
/* Columns were added, so notify the accessible. */
int[] eventData = new int[5];
eventData[0] = ACC.INSERT;
@@ -568,7 +568,7 @@
Rectangle bounds = item.getBounds (false);
int rightX = bounds.x + bounds.width;
updateHorizontalBar (rightX, rightX);
- /*
+ /*
* If new item is above viewport then adjust topIndex and the vertical
* scrollbar so that the current viewport items will not change.
*/
@@ -580,7 +580,7 @@
}
/*
* If this is the first item and the receiver has focus then its boundary
- * focus ring must be removed.
+ * focus ring must be removed.
*/
if (itemsCount == 1 && isFocusControl ()) {
focusItem = item;
@@ -609,12 +609,12 @@
CTableItem item = items [index];
int selectIndex = getSelectionIndex (item);
if (selectIndex == -1) return;
-
+
CTableItem[] newSelectedItems = new CTableItem [selectedItems.length - 1];
System.arraycopy (selectedItems, 0, newSelectedItems, 0, selectIndex);
System.arraycopy (selectedItems, selectIndex + 1, newSelectedItems, selectIndex, newSelectedItems.length - selectIndex);
selectedItems = newSelectedItems;
-
+
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
redrawItem (item.index, false);
}
@@ -622,7 +622,7 @@
}
/**
* Deselects the items at the given zero-relative indices in the receiver.
- * If the item at the given zero-relative index in the receiver
+ * If the item at the given zero-relative index in the receiver
* is selected, it is deselected. If the item at the index
* was not selected, it remains deselected. The range of the
* indices is inclusive. Indices that are out of range are ignored.
@@ -649,7 +649,7 @@
}
/**
* Deselects the items at the given zero-relative indices in the receiver.
- * If the item at the given zero-relative index in the receiver
+ * If the item at the given zero-relative index in the receiver
* is selected, it is deselected. If the item at the index
* was not selected, it remains deselected. Indices that are out
* of range and duplicate indices are ignored.
@@ -757,7 +757,7 @@
for (int i = 0; i < columns.length; i++) {
newWidth += columns [i].width;
}
- ScrollBar hBar = getHorizontalBar ();
+ ScrollBar hBar = getHorizontalBar ();
if (hBar != null) {
hBar.setMaximum (newWidth);
hBar.setVisible (clientArea.width < newWidth);
@@ -807,7 +807,7 @@
items [index] = null; /* last item, so no array copy needed */
}
itemsCount--;
-
+
if (drawCount <= 0 && items.length - itemsCount == 4) {
/* shrink the items array */
CTableItem[] newItems = new CTableItem [itemsCount];
@@ -824,9 +824,9 @@
int oldTopIndex = topIndex;
updateVerticalBar ();
updateHorizontalBar (0, -rightX);
- /*
+ /*
* If destroyed item is above viewport then adjust topIndex and the vertical
- * scrollbar so that the current viewport items will not change.
+ * scrollbar so that the current viewport items will not change.
*/
if (index < topIndex) {
topIndex = oldTopIndex - 1;
@@ -872,7 +872,7 @@
return (Image) display.getData (ID_ARROWUP);
}
int getCellPadding () {
- return MARGIN_CELL + WIDTH_CELL_HIGHLIGHT;
+ return MARGIN_CELL + WIDTH_CELL_HIGHLIGHT;
}
Image getCheckmarkImage () {
return (Image) display.getData (ID_CHECKMARK);
@@ -912,7 +912,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#getColumnOrder()
* @see CTable#setColumnOrder(int[])
* @see CTableColumn#getMoveable()
@@ -953,7 +953,7 @@
* </p><p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
- * not affect the receiver.
+ * not affect the receiver.
* </p>
*
* @return the current visual order of the receiver's items
@@ -962,12 +962,12 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#setColumnOrder(int[])
* @see CTableColumn#getMoveable()
* @see CTableColumn#setMoveable(boolean)
* @see SWT#Move
- *
+ *
* @since 3.1
*/
public int[] getColumnOrder () {
@@ -995,7 +995,7 @@
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
- * not affect the receiver.
+ * not affect the receiver.
* </p>
*
* @return the items in the receiver
@@ -1004,7 +1004,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#getColumnOrder()
* @see CTable#setColumnOrder(int[])
* @see CTableColumn#getMoveable()
@@ -1024,7 +1024,7 @@
* Returns the width in pixels of a grid line.
*
* @return the width of a grid line in pixels
- *
+ *
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -1035,7 +1035,7 @@
return 1;
}
/**
- * Returns the height of the receiver's header
+ * Returns the height of the receiver's header
*
* @return the height of the header or zero if the header is not visible
*
@@ -1043,8 +1043,8 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
- * @since 2.0
+ *
+ * @since 2.0
*/
public int getHeaderHeight () {
checkWidget ();
@@ -1052,7 +1052,7 @@
return header.getSize ().y;
}
int getHeaderPadding () {
- return MARGIN_CELL + WIDTH_HEADER_SHADOW;
+ return MARGIN_CELL + WIDTH_HEADER_SHADOW;
}
/**
* Returns <code>true</code> if the receiver's header is visible,
@@ -1101,8 +1101,8 @@
* coordinate system of the receiver.
* <p>
* The item that is returned represents an item that could be selected by the user.
- * For example, if selection only occurs in items in the first column, then null is
- * returned if the point is outside of the item.
+ * For example, if selection only occurs in items in the first column, then null is
+ * returned if the point is outside of the item.
* Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
* determines the extent of the selection.
* </p>
@@ -1158,11 +1158,11 @@
}
/**
* Returns a (possibly empty) array of <code>TableItem</code>s which
- * are the items in the receiver.
+ * are the items in the receiver.
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its list of items, so modifying the array will
- * not affect the receiver.
+ * not affect the receiver.
* </p>
*
* @return the items in the receiver
@@ -1176,17 +1176,17 @@
checkWidget ();
CTableItem[] result = new CTableItem [itemsCount];
System.arraycopy (items, 0, result, 0, itemsCount);
- return result;
+ return result;
}
/*
- * Returns the current y-coordinate that the specified item should have.
+ * Returns the current y-coordinate that the specified item should have.
*/
int getItemY (CTableItem item) {
return (item.index - topIndex) * itemHeight + getHeaderHeight ();
}
/**
* Returns <code>true</code> if the receiver's lines are visible,
- * and <code>false</code> otherwise. Note that some platforms draw
+ * and <code>false</code> otherwise. Note that some platforms draw
* grid lines while others may draw alternating row colors.
* <p>
* If one of the receiver's ancestors is not visible or some
@@ -1217,7 +1217,7 @@
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its selection, so modifying the array will
- * not affect the receiver.
+ * not affect the receiver.
* </p>
* @return an array representing the selection
*
@@ -1280,7 +1280,7 @@
* <p>
* Note: This is not the actual structure used by the receiver
* to maintain its selection, so modifying the array will
- * not affect the receiver.
+ * not affect the receiver.
* </p>
* @return the array of indices of the selected items
*
@@ -1303,15 +1303,15 @@
* the receiver. The value may be null if no column shows
* the sort indicator.
*
- * @return the sort indicator
+ * @return the sort indicator
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see #setSortColumn(CTableColumn)
- *
+ *
* @since 3.2
*/
public CTableColumn getSortColumn () {
@@ -1319,8 +1319,8 @@
return sortColumn;
}
/**
- * Returns the direction of the sort indicator for the receiver.
- * The value will be one of <code>UP</code>, <code>DOWN</code>
+ * Returns the direction of the sort indicator for the receiver.
+ * The value will be one of <code>UP</code>, <code>DOWN</code>
* or <code>NONE</code>.
*
* @return the sort direction
@@ -1329,9 +1329,9 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see #setSortDirection(int)
- *
+ *
* @since 3.2
*/
public int getSortDirection () {
@@ -1398,7 +1398,7 @@
case SWT.MouseExit:
headerOnMouseExit (); break;
case SWT.Dispose:
- onDispose (event); break;
+ onDispose (event); break;
case SWT.KeyDown:
onKeyDown (event); break;
case SWT.Resize:
@@ -1414,7 +1414,7 @@
case SWT.FocusOut:
onFocusOut (); break;
case SWT.FocusIn:
- onFocusIn (); break;
+ onFocusIn (); break;
case SWT.Traverse:
switch (event.detail) {
case SWT.TRAVERSE_ESCAPE:
@@ -1426,7 +1426,7 @@
event.doit = true;
break;
}
- break;
+ break;
}
}
String headerGetToolTip (int x) {
@@ -1584,7 +1584,7 @@
if (resizeColumn == null) {
/* not currently resizing a column */
for (int i = 0; i < columns.length; i++) {
- CTableColumn column = columns [i];
+ CTableColumn column = columns [i];
int x = column.getX () + column.width;
if (Math.abs (x - event.x) <= TOLLERANCE_COLUMNRESIZE) {
if (column.resizable) {
@@ -1598,9 +1598,9 @@
setCursor (null);
return;
}
-
+
/* currently resizing a column */
-
+
/* don't allow the resize x to move left of the column's x position */
if (event.x <= resizeColumn.getX ()) return;
@@ -1651,7 +1651,7 @@
/* if all damage is to the right of the last column then finished */
if (startColumn == -1) return;
-
+
/* paint each of the column headers */
if (numColumns == 0) return; /* no headers to paint */
for (int i = startColumn; i <= endColumn; i++) {
@@ -1712,7 +1712,7 @@
toolTipLabel.setSize (labelSize);
toolTipShell.pack ();
/*
- * On some platforms, there is a minimum size for a shell
+ * On some platforms, there is a minimum size for a shell
* which may be greater than the label size.
* To avoid having the background of the tip shell showing
* around the label, force the label to fill the entire client area.
@@ -1722,7 +1722,7 @@
/* Position the tooltip and ensure it's not located off the screen */
Point cursorLocation = getDisplay ().getCursorLocation ();
- int cursorHeight = 21; /* assuming cursor is 21x21 */
+ int cursorHeight = 21; /* assuming cursor is 21x21 */
Point size = toolTipShell.getSize ();
Rectangle rect = getMonitor ().getBounds ();
Point pt = new Point (cursorLocation.x, cursorLocation.y + cursorHeight + 2);
@@ -1734,7 +1734,7 @@
}
/**
* Searches the receiver's list starting at the first column
- * (index 0) until a column is found that is equal to the
+ * (index 0) until a column is found that is equal to the
* argument, and returns the index of that column. If no column
* is found, returns -1.
*
@@ -1757,7 +1757,7 @@
}
/**
* Searches the receiver's list starting at the first item
- * (index 0) until an item is found that is equal to the
+ * (index 0) until an item is found that is equal to the
* argument, and returns the index of that item. If no item
* is found, returns -1.
*
@@ -2221,7 +2221,7 @@
return;
}
/* CTRL+Down Arrow */
- int focusIndex = focusItem.index;
+ int focusIndex = focusItem.index;
if (focusIndex == itemsCount - 1) return; /* at bottom */
CTableItem newFocusItem = items [focusIndex + 1];
setFocusItem (newFocusItem, true);
@@ -2266,7 +2266,7 @@
gc.dispose();
}
horizontalOffset = newSelection;
- ScrollBar hBar = getHorizontalBar ();
+ ScrollBar hBar = getHorizontalBar ();
if (hBar != null) hBar.setSelection (horizontalOffset);
}
void onArrowRight (int stateMask) {
@@ -2359,7 +2359,7 @@
return;
}
/* CTRL+Up Arrow */
- int focusIndex = focusItem.index;
+ int focusIndex = focusItem.index;
if (focusIndex == 0) return; /* at top */
CTableItem newFocusItem = items [focusIndex - 1];
setFocusItem (newFocusItem, true);
@@ -2421,7 +2421,7 @@
if ((stateMask & (SWT.CTRL | SWT.SHIFT)) == 0) {
/* End with no modifiers */
if (focusItem.index == lastAvailableIndex) return; /* at bottom */
- CTableItem item = items [lastAvailableIndex];
+ CTableItem item = items [lastAvailableIndex];
selectItem (item, false);
setFocusItem (item, true);
redrawItem (lastAvailableIndex, true);
@@ -2440,7 +2440,7 @@
}
/* Shift+End */
if (focusItem.index == lastAvailableIndex) return; /* at bottom */
- CTableItem item = items [lastAvailableIndex];
+ CTableItem item = items [lastAvailableIndex];
selectItem (item, false);
setFocusItem (item, true);
redrawItem (lastAvailableIndex, true);
@@ -2639,7 +2639,7 @@
return;
}
if ((event.stateMask & SWT.CTRL) != 0) return;
-
+
int initialIndex = focusItem.index;
char character = Character.toLowerCase (event.character);
/* check available items from current focus item to bottom */
@@ -2682,15 +2682,15 @@
int index = (event.y - getHeaderHeight ()) / itemHeight + topIndex;
if (!(0 <= index && index < itemsCount)) return; /* not on an available item */
CTableItem selectedItem = items [index];
-
- /*
+
+ /*
* If the two clicks of the double click did not occur over the same item then do not
* consider this to be a default selection.
*/
if (selectedItem != lastClickedItem) return;
if (!selectedItem.getHitBounds ().contains (event.x, event.y)) return; /* considers x */
-
+
Event newEvent = new Event ();
newEvent.item = selectedItem;
notifyListeners (SWT.DefaultSelection, newEvent);
@@ -2700,7 +2700,7 @@
int index = (event.y - getHeaderHeight ()) / itemHeight + topIndex;
if (!(0 <= index && index < itemsCount)) return; /* not on an available item */
CTableItem selectedItem = items [index];
-
+
/* if click was in checkbox */
if ((getStyle () & SWT.CHECK) != 0 && selectedItem.getCheckboxBounds ().contains (event.x, event.y)) {
if (event.button != 1) return;
@@ -2711,7 +2711,7 @@
notifyListeners (SWT.Selection, newEvent);
return;
}
-
+
if (!selectedItem.getHitBounds ().contains (event.x, event.y)) return;
if ((event.stateMask & SWT.SHIFT) == 0 && event.keyCode != SWT.SHIFT) anchorItem = null;
@@ -3176,9 +3176,9 @@
clientArea = getClientArea ();
}
}
-
- /* horizontal scrollbar */
- ScrollBar hBar = getHorizontalBar ();
+
+ /* horizontal scrollbar */
+ ScrollBar hBar = getHorizontalBar ();
if (hBar != null) {
int hBarMaximum = hBar.getMaximum ();
int thumb = Math.min (clientArea.width, hBarMaximum);
@@ -3191,16 +3191,16 @@
clientArea = getClientArea ();
}
}
-
+
/* header */
int headerHeight = Math.max (fontHeight, headerImageHeight) + 2 * getHeaderPadding ();
header.setSize (clientArea.width, headerHeight);
-
+
/* if this is the focus control but there are no items then the boundary focus ring must be repainted */
if (itemsCount == 0 && isFocusControl ()) redraw ();
}
void onScrollHorizontal (Event event) {
- ScrollBar hBar = getHorizontalBar ();
+ ScrollBar hBar = getHorizontalBar ();
if (hBar == null) return;
int newSelection = hBar.getSelection ();
update ();
@@ -3266,8 +3266,8 @@
*/
void reassignFocus () {
if (focusItem == null) return;
-
- /*
+
+ /*
* reassign to the previous root-level item if there is one, or the next
* root-level item otherwise
*/
@@ -3295,7 +3295,7 @@
checkWidget ();
if (drawCount <= 0) super.redraw (x, y, width, height, all);
}
-/*
+/*
* Redraws from the specified index down to the last available item inclusive. Note
* that the redraw bounds do not extend beyond the current last item, so clients
* that reduce the number of available items should use #redrawItems(int,int) instead
@@ -3380,7 +3380,7 @@
}
/**
* Removes the items from the receiver which are
- * between the given zero-relative start and end
+ * between the given zero-relative start and end
* indices (inclusive).
*
* @param start the start of the range
@@ -3406,7 +3406,7 @@
for (int i = end; i >= start; i--) {
items [i].dispose ();
}
-
+
int[] eventData = new int[5];
eventData[0] = ACC.DELETE;
eventData[1] = start;
@@ -3460,7 +3460,7 @@
}
/**
* Removes all of the items from the receiver.
- *
+ *
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
@@ -3489,7 +3489,7 @@
eventData[3] = 0;
eventData[4] = 0;
getAccessible().sendEvent(ACC.EVENT_TABLE_CHANGED, eventData);
-
+
ScrollBar vBar = getVerticalBar ();
if (vBar != null) {
vBar.setMaximum (1);
@@ -3497,7 +3497,7 @@
}
if (columns.length == 0) {
horizontalOffset = 0;
- ScrollBar hBar = getHorizontalBar ();
+ ScrollBar hBar = getHorizontalBar ();
if (hBar != null) {
hBar.setMaximum (1);
hBar.setVisible (false);
@@ -3550,10 +3550,10 @@
checkWidget ();
if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
removeListener (SWT.Selection, listener);
- removeListener (SWT.DefaultSelection, listener);
+ removeListener (SWT.DefaultSelection, listener);
}
/**
- * Selects the item at the given zero-relative index in the receiver.
+ * Selects the item at the given zero-relative index in the receiver.
* If the item at the index was already selected, it remains
* selected. Indices that are out of range are ignored.
*
@@ -3593,7 +3593,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#setSelection(int,int)
*/
public void select (int start, int end) {
@@ -3630,7 +3630,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#setSelection(int[])
*/
public void select (int [] indices) {
@@ -3703,17 +3703,17 @@
@Override
public void setBackground (Color color) {
checkWidget ();
- if (color == null) color = display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+ if (color == null) color = display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
super.setBackground (color);
}
@Override
public void setForeground (Color color) {
checkWidget ();
- if (color == null) color = display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+ if (color == null) color = display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
super.setForeground (color);
}
/**
- * Sets the order that the items in the receiver should
+ * Sets the order that the items in the receiver should
* be displayed in to the given argument which is described
* in terms of the zero-relative ordering of when the items
* were added.
@@ -3728,12 +3728,12 @@
* <li>ERROR_NULL_ARGUMENT - if the item order is null</li>
* <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
* </ul>
- *
+ *
* @see CTable#getColumnOrder()
* @see CTableColumn#getMoveable()
* @see CTableColumn#setMoveable(boolean)
* @see SWT#Move
- *
+ *
* @since 3.1
*/
public void setColumnOrder (int [] order) {
@@ -3792,9 +3792,9 @@
super.setFont (value);
Font font = getFont ();
if (font.equals (oldFont)) return;
-
+
GC gc = new GC (this);
-
+
/* recompute the receiver's cached font height and item height values */
fontHeight = gc.getFontMetrics ().getHeight ();
setItemHeight (Math.max (fontHeight, imageHeight) + 2 * getCellPadding ());
@@ -3805,7 +3805,7 @@
}
header.setFont (font);
- /*
+ /*
* Notify all columns and items of the font change so that elements that
* use the receiver's font can recompute their cached string widths.
*/
@@ -3815,11 +3815,11 @@
for (int i = 0; i < itemsCount; i++) {
items [i].updateFont (gc);
}
-
+
gc.dispose ();
-
+
if (drawCount <= 0 && header.isVisible ()) header.redraw ();
-
+
/* update scrollbars */
if (columns.length == 0) updateHorizontalBar ();
ScrollBar vBar = getVerticalBar ();
@@ -3842,7 +3842,7 @@
}
/**
* Marks the receiver's header as visible if the argument is <code>true</code>,
- * and marks it invisible otherwise.
+ * and marks it invisible otherwise.
* <p>
* If one of the receiver's ancestors is not visible or some
* other condition makes the receiver not visible, marking
@@ -3886,7 +3886,7 @@
if (count == itemsCount) return;
int oldCount = itemsCount;
int redrawStart, redrawEnd;
-
+
/* if the new item count is less than the current count then remove all excess items from the end */
if (count < itemsCount) {
redrawStart = count;
@@ -3915,7 +3915,7 @@
if (anchorItem != null && anchorItem.isDisposed ()) anchorItem = null;
if (lastClickedItem != null && lastClickedItem.isDisposed ()) lastClickedItem = null;
if (focusItem != null && focusItem.isDisposed ()) {
- CTableItem newFocusItem = count > 0 ? items [count - 1] : null;
+ CTableItem newFocusItem = count > 0 ? items [count - 1] : null;
setFocusItem (newFocusItem, false);
}
int[] eventData = new int[5];
@@ -3961,7 +3961,7 @@
redrawItems (redrawStart, redrawEnd, false);
}
boolean setItemHeight (int value) {
- boolean update = !customHeightSet || itemHeight < value;
+ boolean update = !customHeightSet || itemHeight < value;
if (update) itemHeight = value;
return update;
}
@@ -4029,7 +4029,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public void setSelection (CTableItem item) {
@@ -4072,7 +4072,7 @@
return;
}
CTableItem[] oldSelection = selectedItems;
-
+
/* remove null and duplicate items */
int index = 0;
selectedItems = new CTableItem [items.length]; /* assume all valid items */
@@ -4112,24 +4112,24 @@
showItem (selectedItems [0]);
setFocusItem (selectedItems [0], true);
}
-
+
if (tableSelectionChanged) getAccessible().selectionChanged();
}
/**
* Sets the column used by the sort indicator for the receiver. A null
- * value will clear the sort indicator. The current sort column is cleared
+ * value will clear the sort indicator. The current sort column is cleared
* before the new column is set.
*
* @param column the column used by the sort indicator or <code>null</code>
- *
+ *
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public void setSortColumn (CTableColumn column) {
@@ -4145,16 +4145,16 @@
}
}
/**
- * Sets the direction of the sort indicator for the receiver. The value
+ * Sets the direction of the sort indicator for the receiver. The value
* can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
*
- * @param direction the direction of the sort indicator
+ * @param direction the direction of the sort indicator
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public void setSortDirection (int direction) {
@@ -4165,7 +4165,7 @@
sortColumn.setSortDirection (sortDirection);
}
/**
- * Selects the item at the given zero-relative index in the receiver.
+ * Selects the item at the given zero-relative index in the receiver.
* The current selection is first cleared, then the new item is selected.
*
* @param index the index of the item to select
@@ -4198,7 +4198,7 @@
* If the receiver is single-select and there is more than one item in the
* given range, then all indices are ignored.
* </p>
- *
+ *
* @param start the start index of the items to select
* @param end the end index of the items to select
*
@@ -4329,7 +4329,7 @@
} else {
horizontalOffset = absX + column.width - clientArea.width;
}
- ScrollBar hBar = getHorizontalBar ();
+ ScrollBar hBar = getHorizontalBar ();
if (hBar != null) hBar.setSelection (horizontalOffset);
redraw ();
if (drawCount <= 0 && header.isVisible ()) header.redraw ();
@@ -4357,12 +4357,12 @@
if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
if (item.parent != this) return;
-
+
int index = item.index;
int visibleItemCount = (clientArea.height - getHeaderHeight ()) / itemHeight;
/* nothing to do if item is already in viewport */
if (topIndex <= index && index < topIndex + visibleItemCount) return;
-
+
if (index <= topIndex) {
/* item is above current viewport, so show on top */
setTopIndex (item.index);
@@ -4446,7 +4446,7 @@
if (width > oldWidth) {
/* column width grew */
int change = width - oldWidth + 1; /* +1 offsets x's -1 above */
- /* -1/+1 below ensure that right bound of selection redraws correctly in column */
+ /* -1/+1 below ensure that right bound of selection redraws correctly in column */
redraw (x - 1, 0, change + 1, clientArea.height, false);
} else {
int change = oldWidth - width + 1; /* +1 offsets x's -1 above */
@@ -4522,7 +4522,7 @@
if (drawCount > 0) return;
ScrollBar hBar = getHorizontalBar ();
if (hBar == null) return;
-
+
int maxX = 0;
if (columns.length > 0) {
for (int i = 0; i < columns.length; i++) {
@@ -4534,7 +4534,7 @@
maxX = Math.max (maxX, itemBounds.x + itemBounds.width + horizontalOffset);
}
}
-
+
int clientWidth = clientArea.width;
if (maxX != hBar.getMaximum ()) {
hBar.setMaximum (Math.max (1, maxX)); /* setting a value of 0 here is ignored */
@@ -4545,7 +4545,7 @@
hBar.setPageIncrement (thumb);
}
hBar.setVisible (clientWidth < maxX);
-
+
/* reclaim any space now left on the right */
if (maxX < horizontalOffset + thumb) {
horizontalOffset = maxX - thumb;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
index 50e9243..37723c1 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.accessibility.ACC;
@@ -67,7 +67,7 @@
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
+ * class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
@@ -102,7 +102,7 @@
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
+ * class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
@@ -203,7 +203,7 @@
return CTable.checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
}
void computeDisplayText (GC gc) {
- int availableWidth = width - 2 * parent.getHeaderPadding ();
+ int availableWidth = width - 2 * parent.getHeaderPadding ();
if (super.getImage () != null) {
availableWidth -= super.getImage ().getBounds ().width;
availableWidth -= CTable.MARGIN_IMAGE;
@@ -218,7 +218,7 @@
displayText = text;
return;
}
-
+
/* Ellipsis will be needed, so subtract their width from the available text width */
int ellipsisWidth = gc.stringExtent (CTable.ELLIPSIS).x;
availableWidth -= ellipsisWidth;
@@ -226,7 +226,7 @@
displayText = CTable.ELLIPSIS;
return;
}
-
+
/* Make initial guess. */
int index = Math.min (availableWidth / gc.getFontMetrics ().getAverageCharWidth (), text.length ());
textWidth = gc.textExtent (text.substring (0, index), SWT.DRAW_MNEMONIC).x;
@@ -251,7 +251,7 @@
displayText = text + CTable.ELLIPSIS;
return;
}
-
+
/* Initial guess is too low, so increase until overrun is found. */
while (textWidth < availableWidth) {
index++;
@@ -272,7 +272,7 @@
int width = parentBounds.width - x;
parent.redraw (x, 0, width, parentBounds.height, false);
- /*
+ /*
* If column 0 was disposed then the new column 0 must be redrawn if it appears to the
* left of the disposed column in the column order AND one the following are true:
* - the parent has style CHECK, since these will now appear in the new column 0
@@ -283,7 +283,7 @@
if (parent.columns.length > 0) {
CTableColumn newColumn0 = parent.columns [0];
if (newColumn0.getOrderIndex () < orderIndex) {
- int newColumn0x = newColumn0.getX ();
+ int newColumn0x = newColumn0.getX ();
parent.redraw (newColumn0x, 0, newColumn0.width, parentBounds.height, false);
/* if the alignment changed then the header text must be repainted with its new alignment */
if (nextColumnAlignment != SWT.LEFT && parent.getHeaderVisible () && parent.drawCount <= 0) {
@@ -310,7 +310,7 @@
* text or image in the receiver. The value will be one of
* <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
*
- * @return the alignment
+ * @return the alignment
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -354,8 +354,8 @@
}
/**
* Gets the moveable attribute. A column that is
- * not moveable cannot be reordered by the user
- * by dragging the header but may be reordered
+ * not moveable cannot be reordered by the user
+ * by dragging the header but may be reordered
* by the programmer.
*
* @return the moveable attribute
@@ -364,12 +364,12 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#getColumnOrder()
* @see CTable#setColumnOrder(int[])
* @see CTableColumn#setMoveable(boolean)
* @see SWT#Move
- *
+ *
* @since 3.1
*/
public boolean getMoveable () {
@@ -377,7 +377,7 @@
return moveable;
}
int getOrderIndex () {
- CTableColumn[] orderedColumns = parent.orderedColumns;
+ CTableColumn[] orderedColumns = parent.orderedColumns;
if (orderedColumns == null) return getIndex ();
for (int i = 0; i < orderedColumns.length; i++) {
if (orderedColumns [i] == this) return i;
@@ -431,7 +431,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public String getToolTipText () {
@@ -489,15 +489,15 @@
}
void paint (GC gc) {
int padding = parent.getHeaderPadding ();
-
+
int x = getX ();
int startX = x + padding;
if ((getStyle () & SWT.LEFT) == 0) {
int contentWidth = getContentWidth (gc, true);
if ((getStyle () & SWT.RIGHT) != 0) {
- startX = Math.max (startX, x + width - padding - contentWidth);
+ startX = Math.max (startX, x + width - padding - contentWidth);
} else { /* SWT.CENTER */
- startX = Math.max (startX, x + (width - contentWidth) / 2);
+ startX = Math.max (startX, x + (width - contentWidth) / 2);
}
}
int headerHeight = parent.getHeaderHeight ();
@@ -508,7 +508,7 @@
padding,
width - 2 * padding,
headerHeight - 2 * padding);
-
+
if (super.getImage () != null) {
Rectangle imageBounds = super.getImage ().getBounds ();
int drawHeight = Math.min (imageBounds.height, headerHeight - 2 * padding);
@@ -517,8 +517,8 @@
0, 0,
imageBounds.width, imageBounds.height,
startX, (headerHeight - drawHeight) / 2,
- imageBounds.width, drawHeight);
- startX += imageBounds.width + CTable.MARGIN_IMAGE;
+ imageBounds.width, drawHeight);
+ startX += imageBounds.width + CTable.MARGIN_IMAGE;
}
if (displayText.length () > 0) {
gc.setForeground (getParent ().display.getSystemColor (SWT.COLOR_BLACK));
@@ -586,7 +586,7 @@
* Note that due to a restriction on some platforms, the first column
* is always left aligned.
* </p>
- * @param alignment the new alignment
+ * @param alignment the new alignment
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -626,12 +626,12 @@
if (value == super.getImage ()) return;
if (value != null && value.equals (super.getImage ())) return; /* same value */
super.setImage (value);
-
+
/* An image width change may affect the space available for the column's displayText. */
GC gc = new GC (parent);
computeDisplayText (gc);
gc.dispose ();
-
+
/*
* If this is the first image being put into the header then the header
* height may be adjusted, in which case a full redraw is needed.
@@ -648,7 +648,7 @@
return;
}
}
-
+
if (parent.drawCount <= 0 && parent.getHeaderVisible ()) {
/* don't damage the header's drawn borders */
parent.header.redraw (getX (), 1, width - 2, parent.getHeaderHeight () - 3, false);
@@ -657,8 +657,8 @@
/**
* Sets the moveable attribute. A column that is
* moveable can be reordered by the user by dragging
- * the header. A column that is not moveable cannot be
- * dragged by the user but may be reordered
+ * the header. A column that is not moveable cannot be
+ * dragged by the user but may be reordered
* by the programmer.
*
* @param moveable the moveable attribute
@@ -667,12 +667,12 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @see CTable#setColumnOrder(int[])
* @see CTable#getColumnOrder()
* @see CTableColumn#getMoveable()
* @see SWT#Move
- *
+ *
* @since 3.1
*/
public void setMoveable (boolean moveable) {
@@ -682,8 +682,8 @@
/**
* Sets the resizable attribute. A column that is
* resizable can be resized by the user dragging the
- * edge of the header. A column that is not resizable
- * cannot be dragged by the user but may be resized
+ * edge of the header. A column that is not resizable
+ * cannot be dragged by the user but may be resized
* by the programmer.
*
* @param resizable the resize attribute
@@ -702,7 +702,7 @@
boolean widthChange = value == SWT.NONE || sort == SWT.NONE;
sort = value;
if (widthChange) {
- /*
+ /*
* adding/removing the sort arrow decreases/increases the width that is
* available for the column's header text, so recompute the display text
*/
@@ -731,24 +731,24 @@
}
/**
* Sets the receiver's tool tip text to the argument, which
- * may be null indicating that the default tool tip for the
+ * may be null indicating that the default tool tip for the
* control will be shown. For a control that has a default
* tool tip, such as the Tree control on Windows, setting
* the tool tip text to an empty string replaces the default,
* causing no tool tip text to be shown.
* <p>
* The mnemonic indicator (character '&') is not displayed in a tool tip.
- * To display a single '&' in the tool tip, the character '&' can be
+ * To display a single '&' in the tool tip, the character '&' can be
* escaped by doubling it in the string.
* </p>
- *
+ *
* @param string the new tool tip text (or null)
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public void setToolTipText (String string) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
index e17b85f..e7fb736 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
@@ -68,7 +68,7 @@
Font font;
Font[] cellFonts;
Display display;
-
+
static final int MARGIN_TEXT = 3; /* the left and right margins within the text's space */
/**
@@ -79,7 +79,7 @@
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
+ * class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
@@ -112,7 +112,7 @@
* <p>
* The style value is either one of the style constants defined in
* class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
+ * class, or must be built by <em>bitwise OR</em>'ing together
* (that is, using the <code>int</code> "|" operator) two or more
* of those <code>SWT</code> style constants. The class description
* lists the style constants that are applicable to the class.
@@ -191,7 +191,7 @@
images [1] = super.getImage ();
super.setImage (null);
}
-
+
int[] newTextWidths = new int [columnCount];
System.arraycopy (textWidths, 0, newTextWidths, 0, index);
System.arraycopy (textWidths, index, newTextWidths, index + 1, columnCount - index - 1);
@@ -202,7 +202,7 @@
/*
* The length of displayTexts always matches the parent's column count, unless this
- * count is zero, in which case displayTexts is null.
+ * count is zero, in which case displayTexts is null.
*/
String[] newDisplayTexts = new String [columnCount];
if (columnCount > 1) {
@@ -243,9 +243,9 @@
}
if (index == 0 && columnCount > 1) {
- /*
+ /*
* The new second column may have more width available to it than it did when it was
- * the first column if checkboxes are being shown, so recompute its displayText if needed.
+ * the first column if checkboxes are being shown, so recompute its displayText if needed.
*/
if ((parent.getStyle () & SWT.CHECK) != 0) {
GC gc = new GC (parent);
@@ -358,7 +358,7 @@
textWidths [columnIndex] = textWidth + ellipsisWidth;
return;
}
-
+
/* Initial guess is too low, so increase until overrun is found. */
int previousWidth = 0;
while (textWidth < availableWidth) {
@@ -461,7 +461,7 @@
}
@Override
public void getFocus(AccessibleControlEvent e) {
- e.childID = (parent.focusItem == CTableItem.this && parent.isFocusControl()) ?
+ e.childID = (parent.focusItem == CTableItem.this && parent.isFocusControl()) ?
ACC.CHILDID_SELF : ACC.CHILDID_NONE;
}
@Override
@@ -538,7 +538,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 2.0
*/
public Color getBackground () {
@@ -557,7 +557,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public Color getBackground (int columnIndex) {
@@ -578,7 +578,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.2
*/
public Rectangle getBounds () {
@@ -630,10 +630,10 @@
width,
parent.itemHeight - 1);
}
-
+
CTableColumn column = columns [columnIndex];
if (columnIndex == 0) {
- /*
+ /*
* For column 0 this is bounds from the beginning of the content to the
* end of the column.
*/
@@ -733,7 +733,7 @@
int contentWidth = getContentWidth (columnIndex);
int contentX = 0;
if ((column.getStyle () & SWT.RIGHT) != 0) {
- contentX = column.width - parent.getCellPadding () - contentWidth;
+ contentX = column.width - parent.getCellPadding () - contentWidth;
} else { /* SWT.CENTER */
contentX = (column.width - contentWidth) / 2;
}
@@ -853,7 +853,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 2.0
*/
public Color getForeground () {
@@ -863,7 +863,7 @@
return parent.getForeground ();
}
/**
- *
+ *
* Returns the foreground color at the given column index in the receiver.
*
* @param index the column index
@@ -873,7 +873,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public Color getForeground (int columnIndex) {
@@ -917,13 +917,13 @@
} else {
contentX = getContentX (0);
}
-
+
int width = 0;
CTableColumn[] columns = parent.columns;
if (columns.length == 0) {
width = getContentWidth (0);
} else {
- /*
+ /*
* If there are columns then this spans from the beginning of the receiver's column 0
* image or text to the end of either column 0 or the last column (FULL_SELECTION).
*/
@@ -991,7 +991,7 @@
int itemHeight = parent.itemHeight;
int imageSpaceY = itemHeight - 2 * padding;
int y = parent.getItemY (this);
- Image image = getImage (columnIndex, false);
+ Image image = getImage (columnIndex, false);
int drawWidth = 0;
if (columnIndex == 0) {
/* for column 0 all images have the same width */
@@ -1126,7 +1126,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.3
*/
public Rectangle getTextBounds (int columnIndex) {
@@ -1151,10 +1151,10 @@
width,
parent.itemHeight - 1);
}
-
+
CTableColumn column = columns [columnIndex];
if (columnIndex == 0) {
- /*
+ /*
* For column 0 this is bounds from the beginning of the content to the
* end of the column, starting from the text.
*/
@@ -1182,7 +1182,7 @@
} else {
Image image = getImage (columnIndex, false);
if (image != null) {
- textX += image.getBounds ().width + CTable.MARGIN_IMAGE;
+ textX += image.getBounds ().width + CTable.MARGIN_IMAGE;
}
}
return textX;
@@ -1215,7 +1215,7 @@
x = column.getX ();
}
- /*
+ /*
* Capture GC attributes that will need to be restored later in the paint
* process to ensure that the item paints as intended without being affected
* by GC changes made in MeasureItem/EraseItem/PaintItem callbacks.
@@ -1284,7 +1284,7 @@
/* restrict the clipping region to the cell */
gc.setClipping (x, cellBounds.y, clientArea.width - x, cellBounds.height);
-
+
int y = parent.getItemY (this);
int itemHeight = parent.itemHeight;
@@ -1434,7 +1434,7 @@
String text = getDisplayText (columnIndex);
Rectangle imageArea = getImageBounds (columnIndex);
int startX = imageArea.x;
-
+
/* while painting the cell's content restrict the clipping region */
int padding = parent.getCellPadding ();
gc.setClipping (
@@ -1442,7 +1442,7 @@
cellBounds.y + padding - (parent.linesVisible ? 1 : 0),
cellRightX - startX - padding,
cellBounds.height - 2 * (padding - (parent.linesVisible ? 1 : 0)));
-
+
/* draw the image */
if (image != null) {
Rectangle imageBounds = image.getBounds ();
@@ -1453,7 +1453,7 @@
imageArea.x, imageArea.y, /* dest x, y */
imageArea.width, imageArea.height); /* dest width, height */
}
-
+
/* draw the text */
if (text.length () > 0) {
gc.setFont (getFont (columnIndex, false));
@@ -1548,7 +1548,7 @@
System.arraycopy (texts, 0, newTexts, 0, index);
System.arraycopy (texts, index + 1, newTexts, index, columnCount - index);
texts = newTexts;
-
+
Image[] newImages = new Image [columnCount];
System.arraycopy (images, 0, newImages, 0, index);
System.arraycopy (images, index + 1, newImages, index, columnCount - index);
@@ -1600,9 +1600,9 @@
texts [0] = null;
super.setImage(images [0]);
images [0] = null;
- /*
+ /*
* The new first column may not have as much width available to it as it did when it was
- * the second column if checkboxes are being shown, so recompute its displayText if needed.
+ * the second column if checkboxes are being shown, so recompute its displayText if needed.
*/
if ((parent.getStyle () & SWT.CHECK) != 0) {
GC gc = new GC (parent);
@@ -1624,13 +1624,13 @@
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 2.0
*/
public void setBackground (Color color) {
@@ -1646,7 +1646,7 @@
redrawItem ();
}
/**
- * Sets the background color at the given column index in the receiver
+ * Sets the background color at the given column index in the receiver
* to the color specified by the argument, or to the default system color for the item
* if the argument is null.
*
@@ -1654,13 +1654,13 @@
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public void setBackground (int columnIndex, Color color) {
@@ -1686,7 +1686,7 @@
}
}
/**
- * Sets the checked state of the checkbox for this item. This state change
+ * Sets the checked state of the checkbox for this item. This state change
* only applies if the Table was created with the SWT.CHECK style.
*
* @param checked the new checked state of the checkbox
@@ -1720,13 +1720,13 @@
* @param font the new font (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public void setFont (Font font) {
@@ -1738,7 +1738,7 @@
if (oldFont == font) return;
this.font = font;
if (oldFont != null && oldFont.equals (font)) return;
-
+
Rectangle bounds = getBounds (false);
int oldRightX = bounds.x + bounds.width;
if ((parent.getStyle () & SWT.VIRTUAL) != 0) cached = true;
@@ -1750,7 +1750,7 @@
computeDisplayTexts (gc);
computeTextWidths (gc);
gc.dispose ();
-
+
/* horizontal bar could be affected if table has no columns */
if (parent.columns.length == 0) {
bounds = getBounds (false);
@@ -1761,21 +1761,21 @@
}
/**
* Sets the font that the receiver will use to paint textual information
- * for the specified cell in this item to the font specified by the
- * argument, or to the default font for that kind of control if the
+ * for the specified cell in this item to the font specified by the
+ * argument, or to the default font for that kind of control if the
* argument is null.
*
* @param index the column index
* @param font the new font (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public void setFont (int columnIndex, Font font) {
@@ -1817,13 +1817,13 @@
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 2.0
*/
public void setForeground (Color color) {
@@ -1839,7 +1839,7 @@
redrawItem ();
}
/**
- * Sets the foreground color at the given column index in the receiver
+ * Sets the foreground color at the given column index in the receiver
* to the color specified by the argument, or to the default system color for the item
* if the argument is null.
*
@@ -1847,13 +1847,13 @@
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
- * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @since 3.0
*/
public void setForeground (int columnIndex, Color color) {
@@ -1883,10 +1883,10 @@
}
}
/**
- * Sets the grayed state of the checkbox for this item. This state change
+ * Sets the grayed state of the checkbox for this item. This state change
* only applies if the Table was created with the SWT.CHECK style.
*
- * @param grayed the new grayed state of the checkbox;
+ * @param grayed the new grayed state of the checkbox;
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
@@ -1911,8 +1911,8 @@
setImage (0, value);
}
/**
- * Sets the image for multiple columns in the table.
- *
+ * Sets the image for multiple columns in the table.
+ *
* @param images the array of new images
*
* @exception IllegalArgumentException <ul>
@@ -1927,7 +1927,7 @@
public void setImage (Image[] value) {
checkWidget ();
if (value == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-
+
// TODO make a smarter implementation of this
for (int i = 0; i < value.length; i++) {
if (value [i] != null) setImage (i, value [i]);
@@ -1964,7 +1964,7 @@
}
if ((parent.getStyle () & SWT.VIRTUAL) != 0) cached = true;
- /*
+ /*
* An image width change may affect the space available for the item text, so
* recompute the displayText if there are columns.
*/
@@ -1974,7 +1974,7 @@
computeDisplayText (columnIndex, gc);
gc.dispose ();
}
-
+
if (value == null) {
redrawItem (); // TODO why the whole item?
return;
@@ -1991,7 +1991,7 @@
if (columnIndex == 0) {
parent.col0ImageWidth = value.getBounds ().width;
if (columns.length > 0) {
- /*
+ /*
* All column 0 cells will now have less room available for their texts,
* so all items must now recompute their column 0 displayTexts.
*/
@@ -2008,9 +2008,9 @@
}
}
- /*
+ /*
* If this is the first image being put into column 0 then all cells
- * in the column should also indent accordingly.
+ * in the column should also indent accordingly.
*/
if (columnIndex == 0 && parent.col0ImageWidth == 0) {
parent.col0ImageWidth = value.getBounds ().width;
@@ -2018,7 +2018,7 @@
if (columns.length == 0) {
parent.redraw ();
} else {
- /*
+ /*
* All column 0 cells will now have less room available for their texts,
* so all items must now recompute their column 0 displayTexts.
*/
@@ -2048,7 +2048,7 @@
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
- *
+ *
* @deprecated this functionality is not supported on most platforms
*/
@Deprecated
@@ -2082,7 +2082,7 @@
if (columnIndex == 0) {
super.setText (value);
} else {
- texts [columnIndex] = value;
+ texts [columnIndex] = value;
}
if ((parent.getStyle () & SWT.VIRTUAL) != 0) cached = true;
@@ -2120,8 +2120,8 @@
}
}
/**
- * Sets the text for multiple columns in the table.
- *
+ * Sets the text for multiple columns in the table.
+ *
* @param strings the array of new strings
*
* @exception IllegalArgumentException <ul>
@@ -2165,7 +2165,7 @@
parent.redraw (cellBounds.x, cellBounds.y, cellBounds.width, cellBounds.height, false);
return;
}
- /* if the display text has changed then the cell text must be damaged in order to repaint */
+ /* if the display text has changed then the cell text must be damaged in order to repaint */
if (oldDisplayText == null || !oldDisplayText.equals (displayTexts [columnIndex])) {
Rectangle cellBounds = getCellBounds (columnIndex);
int textX = getTextX (columnIndex);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
index 827825e..6bbf8a8 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.swt.examples.clipboard;
-
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.custom.StyledText;
@@ -100,43 +100,43 @@
shell = new Shell (display);
shell.setText("SWT Clipboard");
shell.setLayout(new FillLayout());
-
+
ScrolledComposite sc = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL);
Composite parent = new Composite(sc, SWT.NONE);
sc.setContent(parent);
parent.setLayout(new GridLayout(2, true));
-
+
Group copyGroup = new Group(parent, SWT.NONE);
copyGroup.setText("Copy From:");
GridData data = new GridData(GridData.FILL_BOTH);
copyGroup.setLayoutData(data);
copyGroup.setLayout(new GridLayout(3, false));
-
+
Group pasteGroup = new Group(parent, SWT.NONE);
pasteGroup.setText("Paste To:");
data = new GridData(GridData.FILL_BOTH);
pasteGroup.setLayoutData(data);
pasteGroup.setLayout(new GridLayout(3, false));
-
+
Group controlGroup = new Group(parent, SWT.NONE);
controlGroup.setText("Control API:");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
controlGroup.setLayoutData(data);
controlGroup.setLayout(new GridLayout(5, false));
-
+
Group typesGroup = new Group(parent, SWT.NONE);
typesGroup.setText("Available Types");
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
typesGroup.setLayoutData(data);
typesGroup.setLayout(new GridLayout(2, false));
-
+
status = new Label(parent, SWT.NONE);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
status.setLayoutData(data);
-
+
createTextTransfer(copyGroup, pasteGroup);
createRTFTransfer(copyGroup, pasteGroup);
createHTMLTransfer(copyGroup, pasteGroup);
@@ -145,11 +145,11 @@
createMyTransfer(copyGroup, pasteGroup);
createControlTransfer(controlGroup);
createAvailableTypes(typesGroup);
-
+
sc.setMinSize(parent.computeSize(SWT.DEFAULT, SWT.DEFAULT));
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
-
+
Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Rectangle monitorArea = shell.getMonitor().getClientArea();
shell.setSize(Math.min(size.x, monitorArea.width - 20), Math.min(size.y, monitorArea.height - 20));
@@ -160,7 +160,7 @@
clipboard.dispose();
}
void createTextTransfer(Composite copyParent, Composite pasteParent) {
-
+
// TextTransfer
Label l = new Label(copyParent, SWT.NONE);
l.setText("TextTransfer:"); //$NON-NLS-1$
@@ -184,7 +184,7 @@
}
}
});
-
+
l = new Label(pasteParent, SWT.NONE);
l.setText("TextTransfer:"); //$NON-NLS-1$
final Text pasteText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -251,7 +251,7 @@
}
}
});
-
+
l = new Label(pasteParent, SWT.NONE);
l.setText("RTFTransfer:"); //$NON-NLS-1$
final Text pasteRtfText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -298,7 +298,7 @@
}
}
});
-
+
l = new Label(pasteParent, SWT.NONE);
l.setText("HTMLTransfer:"); //$NON-NLS-1$
final Text pasteHtmlText = new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -328,14 +328,14 @@
GridData data = new GridData();
data.verticalSpan = 3;
l.setLayoutData(data);
-
+
final Table copyFileTable = new Table(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
data = new GridData(GridData.FILL_BOTH);
data.widthHint = HSIZE;
data.heightHint = VSIZE;
data.verticalSpan = 3;
copyFileTable.setLayoutData(data);
-
+
Button b = new Button(copyParent, SWT.PUSH);
b.setText("Select file(s)");
b.addSelectionListener(new SelectionAdapter() {
@@ -368,7 +368,7 @@
}
}
});
-
+
b = new Button(copyParent, SWT.PUSH);
b.setText("Copy");
b.addSelectionListener(new SelectionAdapter() {
@@ -387,7 +387,7 @@
}
}
});
-
+
l = new Label(pasteParent, SWT.NONE);
l.setText("FileTransfer:"); //$NON-NLS-1$
final Table pasteFileTable = new Table(pasteParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -412,7 +412,7 @@
status.setText("No file to paste");
}
}
- });
+ });
}
void createImageTransfer(Composite copyParent, Composite pasteParent){
@@ -422,17 +422,17 @@
GridData data = new GridData();
data.verticalSpan = 2;
l.setLayoutData(data);
-
+
final Canvas copyImageCanvas = new Canvas(copyParent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
data = new GridData(GridData.FILL_BOTH);
data.verticalSpan = 2;
data.widthHint = HSIZE;
data.heightHint = VSIZE;
- copyImageCanvas.setLayoutData(data);
-
+ copyImageCanvas.setLayoutData(data);
+
final Point copyOrigin = new Point(0, 0);
final ScrollBar copyHBar = copyImageCanvas.getHorizontalBar();
- copyHBar.setEnabled(false);
+ copyHBar.setEnabled(false);
copyHBar.addListener(SWT.Selection, e -> {
if (copyImage[0] != null) {
int hSelection = copyHBar.getSelection();
@@ -488,7 +488,7 @@
copyHBar.setEnabled(true);
copyOrigin.x = 0; copyOrigin.y = 0;
Rectangle rect = copyImage[0].getBounds();
- Rectangle client = copyImageCanvas.getClientArea();
+ Rectangle client = copyImageCanvas.getClientArea();
copyHBar.setMaximum(rect.width);
copyVBar.setMaximum(rect.height);
copyHBar.setThumb(Math.min(rect.width, client.width));
@@ -514,8 +514,8 @@
}
}
});
-
- final Image[] pasteImage = new Image[] {null};
+
+ final Image[] pasteImage = new Image[] {null};
l = new Label(pasteParent, SWT.NONE);
l.setText("ImageTransfer:");
final Canvas pasteImageCanvas = new Canvas(pasteParent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -525,7 +525,7 @@
pasteImageCanvas.setLayoutData(data);
final Point pasteOrigin = new Point(0, 0);
final ScrollBar pasteHBar = pasteImageCanvas.getHorizontalBar();
- pasteHBar.setEnabled(false);
+ pasteHBar.setEnabled(false);
pasteHBar.addListener(SWT.Selection, e -> {
if (pasteImage[0] != null) {
int hSelection = pasteHBar.getSelection();
@@ -566,7 +566,7 @@
b.setText("Paste");
b.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(SelectionEvent e) {
ImageData data =(ImageData)clipboard.getContents(ImageTransfer.getInstance());
if (data != null) {
if (pasteImage[0] != null) {
@@ -580,7 +580,7 @@
pasteHBar.setEnabled(true);
pasteOrigin.x = 0; pasteOrigin.y = 0;
Rectangle rect = pasteImage[0].getBounds();
- Rectangle client = pasteImageCanvas.getClientArea();
+ Rectangle client = pasteImageCanvas.getClientArea();
pasteHBar.setMaximum(rect.width);
pasteVBar.setMaximum(rect.height);
pasteHBar.setThumb(Math.min(rect.width, client.width));
@@ -591,9 +591,9 @@
pasteImageCanvas.redraw();
} else {
status.setText("No image to paste");
- }
+ }
}
- });
+ });
}
void createMyTransfer(Composite copyParent, Composite pasteParent){
// MyType Transfer
@@ -632,7 +632,7 @@
data.widthHint = HSIZE;
data.heightHint = VSIZE;
text.setLayoutData(data);
-
+
l = new Label(parent, SWT.NONE);
l.setText("Combo:");
b = new Button(parent, SWT.PUSH);
@@ -662,7 +662,7 @@
combo = new Combo(parent, SWT.NONE);
combo.setItems("Item 1", "Item 2", "Item 3", "A longer Item");
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
l = new Label(parent, SWT.NONE);
l.setText("StyledText:");
b = new Button(parent, SWT.PUSH);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java
index c6eb7aa..60129ea 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/MyTypeTransfer.java
@@ -14,11 +14,11 @@
import org.eclipse.swt.dnd.*;
public class MyTypeTransfer extends ByteArrayTransfer {
-
+
private static final String MYTYPENAME = "name_list"; //$NON-NLS-1$
private static final int MYTYPEID = registerType(MYTYPENAME);
private static MyTypeTransfer _instance = new MyTypeTransfer();
-
+
public static MyTypeTransfer getInstance () {
return _instance;
}
@@ -27,7 +27,7 @@
if (!checkMyType(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
- MyType[] myTypes = (MyType[]) object;
+ MyType[] myTypes = (MyType[]) object;
try {
// write data to a byte array and then ask super to convert to pMedium
ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -42,17 +42,17 @@
}
byte[] buffer = out.toByteArray();
writeOut.close();
- super.javaToNative(buffer, transferData);
+ super.javaToNative(buffer, transferData);
} catch (IOException e) {
}
}
@Override
-public Object nativeToJava(TransferData transferData){
+public Object nativeToJava(TransferData transferData){
if (isSupportedType(transferData)) {
-
+
byte[] buffer = (byte[])super.nativeToJava(transferData);
if (buffer == null) return null;
-
+
MyType[] myData = new MyType[0];
try {
ByteArrayInputStream in = new ByteArrayInputStream(buffer);
@@ -93,8 +93,8 @@
if (object == null || !(object instanceof MyType[]) || ((MyType[])object).length == 0) return false;
MyType[] myTypes = (MyType[])object;
for (int i = 0; i < myTypes.length; i++) {
- if (myTypes[i] == null ||
- myTypes[i].firstName == null ||
+ if (myTypes[i] == null ||
+ myTypes[i].firstName == null ||
myTypes[i].firstName.length() == 0 ||
myTypes[i].lastName == null ||
myTypes[i].lastName.length() == 0) return false;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java
index 2d101c2..6a71305 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/AlignableTab.java
@@ -37,19 +37,19 @@
}
/**
- * Creates the "Other" group.
+ * Creates the "Other" group.
*/
@Override
void createOtherGroup () {
super.createOtherGroup ();
-
+
/* Create the group */
alignmentGroup = new Group (otherGroup, SWT.NONE);
alignmentGroup.setLayout (new GridLayout ());
alignmentGroup.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_FILL |
GridData.VERTICAL_ALIGN_FILL));
alignmentGroup.setText (ControlExample.getResourceString("Alignment"));
-
+
/* Create the controls */
leftButton = new Button (alignmentGroup, SWT.RADIO);
leftButton.setText (ControlExample.getResourceString("Left"));
@@ -57,7 +57,7 @@
centerButton.setText(ControlExample.getResourceString("Center"));
rightButton = new Button (alignmentGroup, SWT.RADIO);
rightButton.setText (ControlExample.getResourceString("Right"));
-
+
/* Add the listeners */
SelectionListener selectionListener = new SelectionAdapter () {
@Override
@@ -70,12 +70,12 @@
centerButton.addSelectionListener (selectionListener);
rightButton.addSelectionListener (selectionListener);
}
-
+
/**
* Sets the alignment of the "Example" widgets.
*/
abstract void setExampleWidgetAlignment ();
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
index a6d9634..38821cc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ButtonTab.java
@@ -31,27 +31,27 @@
/* Style widgets added to the "Style" group */
Button pushButton, checkButton, radioButton, toggleButton, arrowButton, flatButton, wrapButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
ButtonTab(ControlExample instance) {
super(instance);
}
-
+
/**
- * Creates the "Control" group.
+ * Creates the "Control" group.
*/
@Override
void createControlGroup () {
super.createControlGroup ();
-
+
/* Create the controls */
upButton = new Button (alignmentGroup, SWT.RADIO);
upButton.setText (ControlExample.getResourceString("Up"));
downButton = new Button (alignmentGroup, SWT.RADIO);
downButton.setText (ControlExample.getResourceString("Down"));
-
+
/* Add the listeners */
SelectionListener selectionListener = new SelectionAdapter() {
@Override
@@ -63,14 +63,14 @@
upButton.addSelectionListener(selectionListener);
downButton.addSelectionListener(selectionListener);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for text buttons */
textButtonGroup = new Group(exampleGroup, SWT.NONE);
GridLayout gridLayout = new GridLayout ();
@@ -78,7 +78,7 @@
gridLayout.numColumns = 3;
textButtonGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
textButtonGroup.setText (ControlExample.getResourceString("Text_Buttons"));
-
+
/* Create a group for the image buttons */
imageButtonGroup = new Group(exampleGroup, SWT.NONE);
gridLayout = new GridLayout();
@@ -95,13 +95,13 @@
imagetextButtonGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
imagetextButtonGroup.setText (ControlExample.getResourceString("Image_Text_Buttons"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (pushButton.getSelection()) style |= SWT.PUSH;
@@ -114,13 +114,13 @@
if (leftButton.getSelection()) style |= SWT.LEFT;
if (rightButton.getSelection()) style |= SWT.RIGHT;
if (arrowButton.getSelection()) {
- style |= SWT.ARROW;
+ style |= SWT.ARROW;
if (upButton.getSelection()) style |= SWT.UP;
if (downButton.getSelection()) style |= SWT.DOWN;
} else {
- if (centerButton.getSelection()) style |= SWT.CENTER;
+ if (centerButton.getSelection()) style |= SWT.CENTER;
}
-
+
/* Create the example widgets */
button1 = new Button(textButtonGroup, style);
button1.setText(ControlExample.getResourceString("One"));
@@ -152,14 +152,14 @@
}
button9.setImage(instance.images[ControlExample.ciTarget]);
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
pushButton = new Button (styleGroup, SWT.RADIO);
pushButton.setText("SWT.PUSH");
@@ -178,7 +178,7 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -186,7 +186,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {button1, button2, button3, button4, button5, button6, button7, button8, button9};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -203,7 +203,7 @@
String getTabText () {
return "Button";
}
-
+
/**
* Sets the alignment of the "Example" widgets.
*/
@@ -225,7 +225,7 @@
button8.setAlignment (alignment);
button9.setAlignment (alignment);
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
index f1fd62a..348e6a5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CComboTab.java
@@ -21,10 +21,10 @@
/* Example widgets and groups that contain them */
CCombo combo1;
Group comboGroup;
-
+
/* Style widgets added to the "Style" group */
Button flatButton, readOnlyButton;
-
+
static String [] ListData = {ControlExample.getResourceString("ListData1_0"),
ControlExample.getResourceString("ListData1_1"),
ControlExample.getResourceString("ListData1_2"),
@@ -41,33 +41,33 @@
CComboTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the combo box */
comboGroup = new Group (exampleGroup, SWT.NONE);
comboGroup.setLayout (new GridLayout ());
comboGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
comboGroup.setText (ControlExample.getResourceString("Custom_Combo"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (flatButton.getSelection ()) style |= SWT.FLAT;
if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY;
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
+
/* Create the example widgets */
combo1 = new CCombo (comboGroup, style);
combo1.setItems (ListData);
@@ -75,14 +75,14 @@
combo1.setText(ListData [2]);
}
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup () {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
readOnlyButton = new Button (styleGroup, SWT.CHECK);
readOnlyButton.setText ("SWT.READ_ONLY");
@@ -91,7 +91,7 @@
flatButton = new Button (styleGroup, SWT.CHECK);
flatButton.setText ("SWT.FLAT");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -99,7 +99,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {combo1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -116,7 +116,7 @@
String getTabText () {
return "CCombo";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java
index 50ab050..9249f40 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CLabelTab.java
@@ -23,21 +23,21 @@
/* Style widgets added to the "Style" group */
Button shadowInButton, shadowOutButton, shadowNoneButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
CLabelTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the text labels */
textLabelGroup = new Group(exampleGroup, SWT.NONE);
GridLayout gridLayout = new GridLayout ();
@@ -46,13 +46,13 @@
textLabelGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
textLabelGroup.setText (ControlExample.getResourceString("Custom_Labels"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (shadowInButton.getSelection ()) style |= SWT.SHADOW_IN;
@@ -61,7 +61,7 @@
if (leftButton.getSelection ()) style |= SWT.LEFT;
if (centerButton.getSelection ()) style |= SWT.CENTER;
if (rightButton.getSelection ()) style |= SWT.RIGHT;
-
+
/* Create the example widgets */
label1 = new CLabel (textLabelGroup, style);
label1.setText(ControlExample.getResourceString("One"));
@@ -71,14 +71,14 @@
label3 = new CLabel (textLabelGroup, style);
label3.setText(ControlExample.getResourceString("Example_string") + "\n" + ControlExample.getResourceString("One_Two_Three"));
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
shadowNoneButton = new Button (styleGroup, SWT.RADIO);
shadowNoneButton.setText ("SWT.SHADOW_NONE");
@@ -87,7 +87,7 @@
shadowOutButton = new Button (styleGroup, SWT.RADIO);
shadowOutButton.setText ("SWT.SHADOW_OUT");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -95,7 +95,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {label1, label2, label3};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -112,7 +112,7 @@
String getTabText () {
return "CLabel";
}
-
+
/**
* Sets the alignment of the "Example" widgets.
*/
@@ -126,7 +126,7 @@
label2.setAlignment (alignment);
label3.setAlignment (alignment);
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java
index 04d3c1a..9b71ffb 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ComboTab.java
@@ -21,10 +21,10 @@
/* Example widgets and groups that contain them */
Combo combo1;
Group comboGroup;
-
+
/* Style widgets added to the "Style" group */
Button dropDownButton, readOnlyButton, simpleButton;
-
+
static String [] ListData = {ControlExample.getResourceString("ListData0_0"),
ControlExample.getResourceString("ListData0_1"),
ControlExample.getResourceString("ListData0_2"),
@@ -41,33 +41,33 @@
ComboTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the combo box */
comboGroup = new Group (exampleGroup, SWT.NONE);
comboGroup.setLayout (new GridLayout ());
comboGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
comboGroup.setText ("Combo");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (dropDownButton.getSelection ()) style |= SWT.DROP_DOWN;
if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY;
if (simpleButton.getSelection ()) style |= SWT.SIMPLE;
-
+
/* Create the example widgets */
combo1 = new Combo (comboGroup, style);
combo1.setItems (ListData);
@@ -75,7 +75,7 @@
combo1.setText(ListData [2]);
}
}
-
+
/**
* Creates the tab folder page.
*
@@ -98,7 +98,7 @@
setExampleWidgetSize ();
}
});
-
+
return tabFolderPage;
}
@@ -108,7 +108,7 @@
@Override
void createStyleGroup () {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
dropDownButton = new Button (styleGroup, SWT.RADIO);
dropDownButton.setText ("SWT.DROP_DOWN");
@@ -117,7 +117,7 @@
readOnlyButton = new Button (styleGroup, SWT.CHECK);
readOnlyButton.setText ("SWT.READ_ONLY");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -125,7 +125,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {combo1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -142,7 +142,7 @@
String getTabText () {
return "Combo";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
index 6da9e63..86b2c39 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
@@ -56,7 +56,7 @@
/**
* Creates an instance of a ControlExample embedded inside
* the supplied parent Composite.
- *
+ *
* @param parent the container of the example
*/
public ControlExample(Composite parent) {
@@ -69,7 +69,7 @@
item.setControl (tab.createTabFolderPage (tabFolder));
item.setData (tab);
}
-
+
/* Workaround: if the tab folder is wider than the screen,
* Mac platforms clip instead of somehow scrolling the tab items.
* We try to recover some width by using shorter tab names. */
@@ -122,7 +122,7 @@
/**
* Disposes of all resources associated with a particular
* instance of the ControlExample.
- */
+ */
public void dispose() {
/*
* Destroy any shells that may have been created
@@ -149,7 +149,7 @@
images = null;
}
}
-
+
/**
* Gets a string from the resource bundle.
* We don't want to crash because of a missing String.
@@ -162,7 +162,7 @@
return key;
} catch (NullPointerException e) {
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
- }
+ }
}
/**
@@ -189,7 +189,7 @@
try {
if (images == null) {
images = new Image[imageLocations.length];
-
+
for (int i = 0; i < imageLocations.length; ++i) {
InputStream sourceStream = clazz.getResourceAsStream(imageLocations[i]);
ImageData source = new ImageData(sourceStream);
@@ -234,14 +234,14 @@
instance.dispose();
display.dispose();
}
-
+
/**
* Grabs input focus.
*/
public void setFocus() {
tabFolder.setFocus();
}
-
+
/**
* Sets the size of the shell to it's "packed" size,
* unless that makes it larger than the monitor it is being displayed on,
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
index bde6ee7..3a15a2e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.swt.examples.controlexample;
-
+
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MenuAdapter;
import org.eclipse.swt.events.MenuEvent;
@@ -39,36 +39,36 @@
CoolBar coolBar;
CoolItem pushItem, dropDownItem, radioItem, checkItem, textItem;
Group coolBarGroup;
-
+
/* Style widgets added to the "Style" group */
Button horizontalButton, verticalButton;
Button dropDownButton, flatButton;
/* Other widgets added to the "Other" group */
Button lockedButton;
-
+
Point[] sizes;
int[] wrapIndices;
int[] order;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
CoolBarTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Other" group.
*/
@Override
void createOtherGroup () {
super.createOtherGroup ();
-
+
/* Create display controls specific to this example */
lockedButton = new Button (otherGroup, SWT.CHECK);
lockedButton.setText (ControlExample.getResourceString("Locked"));
-
+
/* Add the listeners */
lockedButton.addSelectionListener (new SelectionAdapter () {
@Override
@@ -77,7 +77,7 @@
}
});
}
-
+
/**
* Creates the "Example" group.
*/
@@ -89,7 +89,7 @@
coolBarGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
coolBarGroup.setText ("CoolBar");
}
-
+
/**
* Creates the "Example" widgets.
*/
@@ -112,12 +112,12 @@
if (borderButton.getSelection()) style |= SWT.BORDER;
if (flatButton.getSelection()) style |= SWT.FLAT;
if (dropDownButton.getSelection()) itemStyle |= SWT.DROP_DOWN;
-
+
/*
* Create the example widgets.
*/
coolBar = new CoolBar (coolBarGroup, style);
-
+
/* Create the push button toolbar cool item */
ToolBar toolBar = new ToolBar (coolBar, toolBarStyle);
ToolItem item = new ToolItem (toolBar, SWT.PUSH);
@@ -135,11 +135,11 @@
item.setToolTipText ("SWT.PUSH");
item = new ToolItem (toolBar, SWT.PUSH);
item.setImage (instance.images[ControlExample.ciOpenFolder]);
- item.setToolTipText ("SWT.PUSH");
+ item.setToolTipText ("SWT.PUSH");
pushItem = new CoolItem (coolBar, itemStyle);
pushItem.setControl (toolBar);
pushItem.addSelectionListener (new CoolItemSelectionListener());
-
+
/* Create the dropdown toolbar cool item */
toolBar = new ToolBar (coolBar, toolBarStyle);
item = new ToolItem (toolBar, SWT.DROP_DOWN);
@@ -168,7 +168,7 @@
radioItem = new CoolItem (coolBar, itemStyle);
radioItem.setControl (toolBar);
radioItem.addSelectionListener (new CoolItemSelectionListener());
-
+
/* Create the check button toolbar cool item */
toolBar = new ToolBar (coolBar, toolBarStyle);
item = new ToolItem (toolBar, SWT.CHECK);
@@ -186,7 +186,7 @@
checkItem = new CoolItem (coolBar, itemStyle);
checkItem.setControl (toolBar);
checkItem.addSelectionListener (new CoolItemSelectionListener());
-
+
/* Create the text cool item */
if (!vertical) {
Text text = new Text (coolBar, SWT.BORDER | SWT.SINGLE);
@@ -220,25 +220,25 @@
coolItem.setPreferredSize(coolSize);
coolItem.setSize(coolSize);
}
-
+
/* If we have saved state, restore it */
if (order != null && order.length == coolBar.getItemCount()) {
coolBar.setItemLayout(order, wrapIndices, sizes);
} else {
coolBar.setWrapIndices(new int[] {1, 3});
}
-
+
/* Add a listener to resize the group box to match the coolbar */
coolBar.addListener(SWT.Resize, event -> exampleGroup.layout());
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup();
-
+
/* Create the extra widgets */
horizontalButton = new Button (styleGroup, SWT.RADIO);
horizontalButton.setText ("SWT.HORIZONTAL");
@@ -255,7 +255,7 @@
dropDownButton = new Button (itemGroup, SWT.CHECK);
dropDownButton.setText ("SWT.DROP_DOWN");
}
-
+
/**
* Disposes the "Example" widgets.
*/
@@ -267,7 +267,7 @@
wrapIndices = coolBar.getWrapIndices();
order = coolBar.getItemOrder();
}
- super.disposeExampleWidgets();
+ super.disposeExampleWidgets();
}
/**
@@ -279,7 +279,7 @@
Item [] getExampleWidgetItems () {
return coolBar.getItems();
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -287,7 +287,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {coolBar};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -312,7 +312,7 @@
String getTabText () {
return "CoolBar";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -327,14 +327,14 @@
lockedButton.setSelection(coolBar.getLocked());
if (!instance.startup) setWidgetLocked ();
}
-
+
/**
* Sets the header visible state of the "Example" widgets.
*/
void setWidgetLocked () {
coolBar.setLocked (lockedButton.getSelection ());
}
-
+
/**
* Listens to widgetSelected() events on SWT.DROP_DOWN type ToolItems
* and opens/closes a menu when appropriate.
@@ -342,7 +342,7 @@
class DropDownSelectionListener extends SelectionAdapter {
private Menu menu = null;
private boolean visible = false;
-
+
@Override
public void widgetSelected(SelectionEvent event) {
// Create the menu if it has not already been created
@@ -375,13 +375,13 @@
}
}
}
-
+
/**
* A selection event will be fired when a drop down tool
* item is selected in the main area and in the drop
* down arrow. Examine the event detail to determine
* where the widget was selected.
- */
+ */
if (event.detail == SWT.ARROW) {
/*
* The drop down arrow was selected.
@@ -389,11 +389,11 @@
if (visible) {
// Hide the menu to give the Arrow the appearance of being a toggle button.
setMenuVisible(false);
- } else {
+ } else {
// Position the menu below and vertically aligned with the the drop down tool button.
final ToolItem toolItem = (ToolItem) event.widget;
final ToolBar toolBar = toolItem.getParent();
-
+
Rectangle toolItemBounds = toolItem.getBounds();
Point point = toolBar.toDisplay(new Point(toolItemBounds.x, toolItemBounds.y));
menu.setLocation(point.x, point.y + toolItemBounds.height);
@@ -418,7 +418,7 @@
*/
class CoolItemSelectionListener extends SelectionAdapter {
private Menu menu = null;
-
+
@Override
public void widgetSelected(SelectionEvent event) {
/**
@@ -436,7 +436,7 @@
menu = null;
return;
}
-
+
/* Get the cool item and convert its bounds to display coordinates. */
CoolItem coolItem = (CoolItem) event.widget;
Rectangle itemBounds = coolItem.getBounds ();
@@ -444,12 +444,12 @@
Point pt = coolBar.toDisplay(new Point (itemBounds.x, itemBounds.y));
itemBounds.x = pt.x;
itemBounds.y = pt.y;
-
+
/* Get the toolbar from the cool item. */
ToolBar toolBar = (ToolBar) coolItem.getControl ();
ToolItem[] tools = toolBar.getItems ();
int toolCount = tools.length;
-
+
/* Convert the bounds of each tool item to display coordinates,
* and determine which ones are past the bounds of the cool item.
*/
@@ -463,7 +463,7 @@
if (!intersection.equals (toolBounds)) break;
i++;
}
-
+
/* Create a pop-up menu with items for each of the hidden buttons. */
menu = new Menu (shell, SWT.POP_UP | (coolBar.getStyle() & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT)));
for (int j = i; j < toolCount; j++) {
@@ -498,7 +498,7 @@
/* Application code to perform the action for the menu item would go here. */
}
}
-
+
/* Display the pop-up menu at the lower left corner of the arrow button.
* Dispose the menu when the user is done with it.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java
index cde0c0b..7f0cecf 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CustomControlExample.java
@@ -19,13 +19,13 @@
/**
* Creates an instance of a CustomControlExample embedded
* inside the supplied parent Composite.
- *
+ *
* @param parent the container of the example
*/
public CustomControlExample(Composite parent) {
super (parent);
}
-
+
/**
* Answers the set of example Tabs
*/
@@ -39,7 +39,7 @@
new StyledTextTab (this),
};
}
-
+
/**
* Invokes as a standalone program.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
index ff69574..4d98af7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DateTimeTab.java
@@ -19,37 +19,37 @@
/* Example widgets and groups that contain them */
DateTime dateTime1;
Group dateTimeGroup;
-
+
/* Style widgets added to the "Style" group */
Button dateButton, timeButton, calendarButton, shortButton, mediumButton, longButton, dropDownButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
DateTimeTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the list */
dateTimeGroup = new Group (exampleGroup, SWT.NONE);
dateTimeGroup.setLayout (new GridLayout ());
dateTimeGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
dateTimeGroup.setText ("DateTime");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (dateButton.getSelection ()) style |= SWT.DATE;
@@ -60,18 +60,18 @@
if (longButton.getSelection ()) style |= SWT.LONG;
if (dropDownButton.getSelection ()) style |= SWT.DROP_DOWN;
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
- /* Create the example widgets */
+
+ /* Create the example widgets */
dateTime1 = new DateTime (dateTimeGroup, style);
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
dateButton = new Button(styleGroup, SWT.RADIO);
dateButton.setText("SWT.DATE");
@@ -92,7 +92,7 @@
borderButton = new Button(styleGroup, SWT.CHECK);
borderButton.setText("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -100,7 +100,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {dateTime1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -109,7 +109,7 @@
String[] getMethodNames() {
return new String[] {"Day", "Hours", "Minutes", "Month", "Seconds", "Year"};
}
-
+
/**
* Gets the short text for the tab folder item.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
index c868b45..9136f61 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/DialogTab.java
@@ -22,7 +22,7 @@
/* Example widgets and groups that contain them */
Group dialogStyleGroup, resultGroup;
Text textWidget;
-
+
/* Style widgets added to the "Style" group */
Combo dialogCombo;
Button createButton;
@@ -75,7 +75,7 @@
boolean abort = abortButton.getSelection ();
boolean retry = retryButton.getSelection ();
boolean ignore = ignoreButton.getSelection ();
-
+
okButton.setEnabled (!(yes || no || retry || abort || ignore));
cancelButton.setEnabled (!(abort || ignore || (yes != no)));
yesButton.setEnabled (!(ok || retry || abort || ignore || (cancel && !yes && !no)));
@@ -83,7 +83,7 @@
retryButton.setEnabled (!(ok || yes || no));
abortButton.setEnabled (!(ok || cancel || yes || no));
ignoreButton.setEnabled (!(ok || cancel || yes || no));
-
+
createButton.setEnabled (
!(ok || cancel || yes || no || retry || abort || ignore) ||
ok ||
@@ -92,17 +92,17 @@
(yes && no && cancel) ||
(retry && cancel) ||
(abort && retry && ignore));
-
+
}
-
+
/**
* Handle the create button selection event.
*
* @param event org.eclipse.swt.events.SelectionEvent
*/
void createButtonSelected(SelectionEvent event) {
-
+
/* Compute the appropriate dialog style */
int style = getDefaultStyle();
if (okButton.getEnabled () && okButton.getSelection ()) style |= SWT.OK;
@@ -124,10 +124,10 @@
if (saveButton.getEnabled () && saveButton.getSelection ()) style |= SWT.SAVE;
if (openButton.getEnabled () && openButton.getSelection ()) style |= SWT.OPEN;
if (multiButton.getEnabled () && multiButton.getSelection ()) style |= SWT.MULTI;
-
+
/* Open the appropriate dialog type */
String name = dialogCombo.getText ();
-
+
if (name.equals (ControlExample.getResourceString("ColorDialog"))) {
ColorDialog dialog = new ColorDialog (shell ,style);
if (usePreviousResultButton.getSelection()) {
@@ -151,7 +151,7 @@
colorDialogCustomColors = rgbs;
return;
}
-
+
if (name.equals (ControlExample.getResourceString("DirectoryDialog"))) {
DirectoryDialog dialog = new DirectoryDialog (shell, style);
if (usePreviousResultButton.getSelection()) {
@@ -165,7 +165,7 @@
directoryDialogResult = result;
return;
}
-
+
if (name.equals (ControlExample.getResourceString("FileDialog"))) {
FileDialog dialog = new FileDialog (shell, style);
if (usePreviousResultButton.getSelection()) {
@@ -191,7 +191,7 @@
fileDialogIndexResult = dialog.getFilterIndex();
return;
}
-
+
if (name.equals (ControlExample.getResourceString("FontDialog"))) {
FontDialog dialog = new FontDialog (shell, style);
if (usePreviousResultButton.getSelection()) {
@@ -216,7 +216,7 @@
fontDialogColorResult = dialog.getRGB();
return;
}
-
+
if (name.equals (ControlExample.getResourceString("PrintDialog"))) {
PrintDialog dialog = new PrintDialog (shell, style);
if (usePreviousResultButton.getSelection()) {
@@ -241,7 +241,7 @@
printDialogResult = result;
return;
}
-
+
if (name.equals(ControlExample.getResourceString("MessageBox"))) {
MessageBox dialog = new MessageBox (shell, style);
dialog.setMessage (ControlExample.getResourceString("Example_string"));
@@ -265,7 +265,7 @@
case SWT.CANCEL:
textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.CANCEL"}));
break;
- case SWT.ABORT:
+ case SWT.ABORT:
textWidget.append (ControlExample.getResourceString("Result", new String [] {"SWT.ABORT"}));
break;
case SWT.RETRY:
@@ -281,9 +281,9 @@
textWidget.append (Text.DELIMITER + Text.DELIMITER);
}
}
-
+
/**
- * Creates the "Control" group.
+ * Creates the "Control" group.
*/
@Override
void createControlGroup () {
@@ -291,7 +291,7 @@
* Create the "Control" group. This is the group on the
* right half of each example tab. It consists of the
* style group, the display group and the size group.
- */
+ */
controlGroup = new Group (tabFolderPage, SWT.NONE);
GridLayout gridLayout= new GridLayout ();
controlGroup.setLayout(gridLayout);
@@ -299,7 +299,7 @@
gridLayout.makeColumnsEqualWidth = true;
controlGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
controlGroup.setText (ControlExample.getResourceString("Parameters"));
-
+
/*
* Create a group to hold the dialog style combo box and
* create dialog button.
@@ -311,16 +311,16 @@
dialogStyleGroup.setLayoutData (gridData);
dialogStyleGroup.setText (ControlExample.getResourceString("Dialog_Type"));
}
-
+
/**
* Creates the "Control" widget children.
*/
@Override
void createControlWidgets () {
-
+
/* Create the combo */
String [] strings = {
- ControlExample.getResourceString("ColorDialog"),
+ ControlExample.getResourceString("ColorDialog"),
ControlExample.getResourceString("DirectoryDialog"),
ControlExample.getResourceString("FileDialog"),
ControlExample.getResourceString("FontDialog"),
@@ -331,18 +331,18 @@
dialogCombo.setItems (strings);
dialogCombo.setText (strings [0]);
dialogCombo.setVisibleItemCount(strings.length);
-
+
/* Create the create dialog button */
createButton = new Button(dialogStyleGroup, SWT.NONE);
createButton.setText (ControlExample.getResourceString("Create_Dialog"));
createButton.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
-
+
/* Create a group for the various dialog button style controls */
Group buttonStyleGroup = new Group (controlGroup, SWT.NONE);
buttonStyleGroup.setLayout (new GridLayout ());
buttonStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
buttonStyleGroup.setText (ControlExample.getResourceString("Button_Styles"));
-
+
/* Create the button style buttons */
okButton = new Button (buttonStyleGroup, SWT.CHECK);
okButton.setText ("SWT.OK");
@@ -358,13 +358,13 @@
abortButton.setText ("SWT.ABORT");
ignoreButton = new Button (buttonStyleGroup, SWT.CHECK);
ignoreButton.setText ("SWT.IGNORE");
-
+
/* Create a group for the icon style controls */
Group iconStyleGroup = new Group (controlGroup, SWT.NONE);
iconStyleGroup.setLayout (new GridLayout ());
iconStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
iconStyleGroup.setText (ControlExample.getResourceString("Icon_Styles"));
-
+
/* Create the icon style buttons */
iconErrorButton = new Button (iconStyleGroup, SWT.RADIO);
iconErrorButton.setText ("SWT.ICON_ERROR");
@@ -378,13 +378,13 @@
iconWorkingButton.setText ("SWT.ICON_WORKING");
noIconButton = new Button (iconStyleGroup, SWT.RADIO);
noIconButton.setText (ControlExample.getResourceString("No_Icon"));
-
+
/* Create a group for the modal style controls */
Group modalStyleGroup = new Group (controlGroup, SWT.NONE);
modalStyleGroup.setLayout (new GridLayout ());
modalStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
modalStyleGroup.setText (ControlExample.getResourceString("Modal_Styles"));
-
+
/* Create the modal style buttons */
primaryModalButton = new Button (modalStyleGroup, SWT.RADIO);
primaryModalButton.setText ("SWT.PRIMARY_MODAL");
@@ -392,13 +392,13 @@
applicationModalButton.setText ("SWT.APPLICATION_MODAL");
systemModalButton = new Button (modalStyleGroup, SWT.RADIO);
systemModalButton.setText ("SWT.SYSTEM_MODAL");
-
+
/* Create a group for the file dialog style controls */
Group fileDialogStyleGroup = new Group (controlGroup, SWT.NONE);
fileDialogStyleGroup.setLayout (new GridLayout ());
fileDialogStyleGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
fileDialogStyleGroup.setText (ControlExample.getResourceString("File_Dialog_Styles"));
-
+
/* Create the file dialog style buttons */
openButton = new Button(fileDialogStyleGroup, SWT.RADIO);
openButton.setText("SWT.OPEN");
@@ -406,18 +406,18 @@
saveButton.setText ("SWT.SAVE");
multiButton = new Button(fileDialogStyleGroup, SWT.CHECK);
multiButton.setText("SWT.MULTI");
-
+
/* Create the orientation group */
if (RTL_SUPPORT_ENABLE) {
createOrientationGroup();
}
-
+
/* Create a group for other style and setting controls */
Group otherGroup = new Group (controlGroup, SWT.NONE);
otherGroup.setLayout (new GridLayout ());
otherGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
otherGroup.setText (ControlExample.getResourceString("Other"));
-
+
/* Create the other style and setting controls */
sheetButton = new Button(otherGroup, SWT.CHECK);
sheetButton.setText("SWT.SHEET");
@@ -452,7 +452,7 @@
retryButton.addSelectionListener (buttonStyleListener);
abortButton.addSelectionListener (buttonStyleListener);
ignoreButton.addSelectionListener (buttonStyleListener);
-
+
/* Set default values for style buttons */
okButton.setEnabled (false);
cancelButton.setEnabled (false);
@@ -475,7 +475,7 @@
effectsVisibleButton.setEnabled(false);
effectsVisibleButton.setSelection(true);
}
-
+
/**
* Creates the "Example" group.
*/
@@ -483,7 +483,7 @@
void createExampleGroup () {
super.createExampleGroup ();
exampleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
-
+
/*
* Create a group for the text widget to display
* the results returned by the example dialogs.
@@ -493,7 +493,7 @@
resultGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
resultGroup.setText (ControlExample.getResourceString("Dialog_Result"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@@ -504,9 +504,9 @@
*/
textWidget = new Text(resultGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridData gridData = new GridData (GridData.FILL_BOTH);
- textWidget.setLayoutData (gridData);
+ textWidget.setLayoutData (gridData);
}
-
+
/**
* The platform dialogs do not have SWT listeners.
*/
@@ -520,7 +520,7 @@
* @param event the selection event
*/
void dialogSelected (SelectionEvent event) {
-
+
/* Enable/Disable the buttons */
String name = dialogCombo.getText ();
boolean isMessageBox = name.equals (ControlExample.getResourceString("MessageBox"));
@@ -544,7 +544,7 @@
multiButton.setEnabled (isFileDialog);
effectsVisibleButton.setEnabled (isFontDialog);
usePreviousResultButton.setEnabled (!isMessageBox);
-
+
/* Deselect the buttons */
if (!isMessageBox) {
okButton.setSelection (false);
@@ -556,7 +556,7 @@
ignoreButton.setSelection (false);
}
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -564,7 +564,7 @@
Widget [] getExampleWidgets () {
return new Widget [0];
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -572,7 +572,7 @@
String getTabText () {
return "Dialog";
}
-
+
/**
* Recreates the "Example" widgets.
*/
@@ -580,6 +580,6 @@
void recreateExampleWidgets () {
if (textWidget == null) {
super.recreateExampleWidgets ();
- }
+ }
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
index 00a28e1..f49c1eb 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ExpandBarTab.java
@@ -19,8 +19,8 @@
/* Example widgets and groups that contain them */
ExpandBar expandBar1;
Group expandBarGroup;
-
- /* Style widgets added to the "Style" group */
+
+ /* Style widgets added to the "Style" group */
Button verticalButton;
/**
@@ -29,35 +29,35 @@
ExpandBarTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the list */
expandBarGroup = new Group (exampleGroup, SWT.NONE);
expandBarGroup.setLayout (new GridLayout ());
expandBarGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
expandBarGroup.setText ("ExpandBar");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (borderButton.getSelection ()) style |= SWT.BORDER;
if (verticalButton.getSelection()) style |= SWT.V_SCROLL;
-
- /* Create the example widgets */
+
+ /* Create the example widgets */
expandBar1 = new ExpandBar (expandBarGroup, style);
-
+
// First item
Composite composite = new Composite (expandBar1, SWT.NONE);
composite.setLayout(new GridLayout ());
@@ -70,10 +70,10 @@
item.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
item.setControl(composite);
item.setImage(instance.images[ControlExample.ciClosedFolder]);
-
+
// Second item
composite = new Composite (expandBar1, SWT.NONE);
- composite.setLayout(new GridLayout (2, false));
+ composite.setLayout(new GridLayout (2, false));
new Label (composite, SWT.NONE).setImage(display.getSystemImage(SWT.ICON_ERROR));
new Label (composite, SWT.NONE).setText("SWT.ICON_ERROR");
new Label (composite, SWT.NONE).setImage(display.getSystemImage(SWT.ICON_INFORMATION));
@@ -89,14 +89,14 @@
item.setImage(instance.images[ControlExample.ciOpenFolder]);
item.setExpanded(true);
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
verticalButton = new Button (styleGroup, SWT.CHECK);
verticalButton.setText ("SWT.V_SCROLL");
@@ -104,7 +104,7 @@
borderButton = new Button(styleGroup, SWT.CHECK);
borderButton.setText("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -112,7 +112,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {expandBar1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -121,7 +121,7 @@
String[] getMethodNames() {
return new String[] {"Spacing"};
}
-
+
/**
* Gets the short text for the tab folder item.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
index efca6ef..7931cbb 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/GroupTab.java
@@ -18,11 +18,11 @@
class GroupTab extends Tab {
Button titleButton;
-
+
/* Example widgets and groups that contain them */
Group group1;
Group groupGroup;
-
+
/* Style widgets added to the "Style" group */
Button shadowEtchedInButton, shadowEtchedOutButton, shadowInButton, shadowOutButton, shadowNoneButton;
@@ -32,18 +32,18 @@
GroupTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Other" group.
*/
@Override
void createOtherGroup () {
super.createOtherGroup ();
-
+
/* Create display controls specific to this example */
titleButton = new Button (otherGroup, SWT.CHECK);
titleButton.setText (ControlExample.getResourceString("Title_Text"));
-
+
/* Add the listeners */
titleButton.addSelectionListener (new SelectionAdapter () {
@Override
@@ -52,27 +52,27 @@
}
});
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the Group */
groupGroup = new Group (exampleGroup, SWT.NONE);
groupGroup.setLayout (new GridLayout ());
groupGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
groupGroup.setText ("Group");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (shadowEtchedInButton.getSelection ()) style |= SWT.SHADOW_ETCHED_IN;
@@ -85,14 +85,14 @@
/* Create the example widgets */
group1 = new Group (groupGroup, style);
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
shadowEtchedInButton = new Button (styleGroup, SWT.RADIO);
shadowEtchedInButton.setText ("SWT.SHADOW_ETCHED_IN");
@@ -108,7 +108,7 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -116,7 +116,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {group1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java
index feae21e..51a4194 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LabelTab.java
@@ -22,21 +22,21 @@
/* Style widgets added to the "Style" group */
Button wrapButton, separatorButton, horizontalButton, verticalButton, shadowInButton, shadowOutButton, shadowNoneButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
LabelTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the text labels */
textLabelGroup = new Group(exampleGroup, SWT.NONE);
GridLayout gridLayout = new GridLayout ();
@@ -44,7 +44,7 @@
gridLayout.numColumns = 3;
textLabelGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
textLabelGroup.setText (ControlExample.getResourceString("Text_Labels"));
-
+
/* Create a group for the image labels */
imageLabelGroup = new Group (exampleGroup, SWT.SHADOW_NONE);
gridLayout = new GridLayout ();
@@ -53,13 +53,13 @@
imageLabelGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
imageLabelGroup.setText (ControlExample.getResourceString("Image_Labels"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (wrapButton.getSelection ()) style |= SWT.WRAP;
@@ -73,7 +73,7 @@
if (leftButton.getSelection ()) style |= SWT.LEFT;
if (centerButton.getSelection ()) style |= SWT.CENTER;
if (rightButton.getSelection ()) style |= SWT.RIGHT;
-
+
/* Create the example widgets */
label1 = new Label (textLabelGroup, style);
label1.setText(ControlExample.getResourceString("One"));
@@ -92,14 +92,14 @@
label6 = new Label(imageLabelGroup, style);
label6.setImage (instance.images[ControlExample.ciTarget]);
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
wrapButton = new Button (styleGroup, SWT.CHECK);
wrapButton.setText ("SWT.WRAP");
@@ -120,7 +120,7 @@
borderButton = new Button(styleGroup, SWT.CHECK);
borderButton.setText("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -128,7 +128,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {label1, label2, label3, label4, label5, label6};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -145,7 +145,7 @@
String getTabText () {
return "Label";
}
-
+
/**
* Sets the alignment of the "Example" widgets.
*/
@@ -162,7 +162,7 @@
label5.setAlignment (alignment);
label6.setAlignment (alignment);
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -178,7 +178,7 @@
shadowOutButton.setSelection (isSeparator && (label1.getStyle () & SWT.SHADOW_OUT) != 0);
shadowNoneButton.setSelection (isSeparator && (label1.getStyle () & SWT.SHADOW_NONE) != 0);
horizontalButton.setSelection (isSeparator && (label1.getStyle () & SWT.HORIZONTAL) != 0);
- verticalButton.setSelection (isSeparator && (label1.getStyle () & SWT.VERTICAL) != 0);
+ verticalButton.setSelection (isSeparator && (label1.getStyle () & SWT.VERTICAL) != 0);
wrapButton.setEnabled (!isSeparator);
leftButton.setEnabled (!isSeparator);
centerButton.setEnabled (!isSeparator);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java
index b707d0c..929fae7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/LinkTab.java
@@ -19,55 +19,55 @@
/* Example widgets and groups that contain them */
Link link1;
Group linkGroup;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
LinkTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the list */
linkGroup = new Group (exampleGroup, SWT.NONE);
linkGroup.setLayout (new GridLayout ());
linkGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
linkGroup.setText ("Link");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
- /* Create the example widgets */
+
+ /* Create the example widgets */
link1 = new Link (linkGroup, style);
link1.setText (ControlExample.getResourceString("LinkText"));
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
borderButton = new Button(styleGroup, SWT.CHECK);
borderButton.setText("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -75,7 +75,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {link1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -84,7 +84,7 @@
String[] getMethodNames() {
return new String[] {"Text", "ToolTipText"};
}
-
+
/**
* Gets the text for the tab folder item.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java
index 156b1d9..a6e6657 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ListTab.java
@@ -20,7 +20,7 @@
/* Example widgets and groups that contain them */
List list1;
Group listGroup;
-
+
static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"),
ControlExample.getResourceString("ListData1_1"),
ControlExample.getResourceString("ListData1_2"),
@@ -37,27 +37,27 @@
ListTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the list */
listGroup = new Group (exampleGroup, SWT.NONE);
listGroup.setLayout (new GridLayout ());
listGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
listGroup.setText ("List");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (singleButton.getSelection ()) style |= SWT.SINGLE;
@@ -65,12 +65,12 @@
if (horizontalButton.getSelection ()) style |= SWT.H_SCROLL;
if (verticalButton.getSelection ()) style |= SWT.V_SCROLL;
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
+
/* Create the example widgets */
list1 = new List (listGroup, style);
list1.setItems (ListData1);
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -78,7 +78,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {list1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java
index b8da59a..814510a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ProgressBarTab.java
@@ -136,7 +136,7 @@
int getDefaultMaximum () {
return progressBar1.getMaximum();
}
-
+
/**
* Gets the default minimim of the "Example" widgets.
*/
@@ -144,7 +144,7 @@
int getDefaultMinimum () {
return progressBar1.getMinimum();
}
-
+
/**
* Gets the default selection of the "Example" widgets.
*/
@@ -181,7 +181,7 @@
}
/**
- * Update the Spinner widgets to reflect the actual value set
+ * Update the Spinner widgets to reflect the actual value set
* on the "Example" widget.
*/
void updateSpinners () {
@@ -189,7 +189,7 @@
updateSpinner (selectionSpinner, progressBar1.getSelection ());
updateSpinner (maximumSpinner, progressBar1.getMaximum ());
}
-
+
void updateSpinner(Spinner spinner, int selection) {
if (spinner.getSelection() != selection) spinner.setSelection (selection);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
index de9f802..74b73f4 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/RangeTab.java
@@ -41,19 +41,19 @@
createMaximumGroup ();
createSelectionGroup ();
}
-
+
/**
* Create a group of widgets to control the maximum
* attribute of the example widget.
*/
void createMaximumGroup() {
-
+
/* Create the group */
Group maximumGroup = new Group (controlGroup, SWT.NONE);
maximumGroup.setLayout (new GridLayout ());
maximumGroup.setText (ControlExample.getResourceString("Maximum"));
maximumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create a Spinner widget */
maximumSpinner = new Spinner (maximumGroup, SWT.BORDER);
maximumSpinner.setMaximum (100000);
@@ -61,7 +61,7 @@
maximumSpinner.setPageIncrement (100);
maximumSpinner.setIncrement (1);
maximumSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
-
+
/* Add the listeners */
maximumSpinner.addSelectionListener(new SelectionAdapter () {
@Override
@@ -70,19 +70,19 @@
}
});
}
-
+
/**
* Create a group of widgets to control the minimum
* attribute of the example widget.
*/
void createMinimumGroup() {
-
+
/* Create the group */
Group minimumGroup = new Group (controlGroup, SWT.NONE);
minimumGroup.setLayout (new GridLayout ());
minimumGroup.setText (ControlExample.getResourceString("Minimum"));
minimumGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create a Spinner widget */
minimumSpinner = new Spinner (minimumGroup, SWT.BORDER);
minimumSpinner.setMaximum (100000);
@@ -98,22 +98,22 @@
setWidgetMinimum ();
}
});
-
+
}
-
+
/**
* Create a group of widgets to control the selection
* attribute of the example widget.
*/
void createSelectionGroup() {
-
+
/* Create the group */
Group selectionGroup = new Group(controlGroup, SWT.NONE);
selectionGroup.setLayout(new GridLayout());
GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, false, false);
selectionGroup.setLayoutData(gridData);
selectionGroup.setText(ControlExample.getResourceString("Selection"));
-
+
/* Create a Spinner widget */
selectionSpinner = new Spinner (selectionGroup, SWT.BORDER);
selectionSpinner.setMaximum (100000);
@@ -129,16 +129,16 @@
setWidgetSelection ();
}
});
-
+
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup () {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
if (orientationButtons) {
horizontalButton = new Button (styleGroup, SWT.RADIO);
@@ -149,7 +149,7 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -170,17 +170,17 @@
borderButton.setSelection ((widgets [0].getStyle () & SWT.BORDER) != 0);
}
}
-
+
/**
* Gets the default maximum of the "Example" widgets.
*/
abstract int getDefaultMaximum ();
-
+
/**
* Gets the default minimim of the "Example" widgets.
*/
abstract int getDefaultMinimum ();
-
+
/**
* Gets the default selection of the "Example" widgets.
*/
@@ -190,12 +190,12 @@
* Sets the maximum of the "Example" widgets.
*/
abstract void setWidgetMaximum ();
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
abstract void setWidgetMinimum ();
-
+
/**
* Sets the selection of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java
index ed135bd..3a8743a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashFormTab.java
@@ -22,7 +22,7 @@
SashForm form;
List list1, list2;
Text text;
-
+
/* Style widgets added to the "Style" group */
Button horizontalButton, verticalButton, smoothButton;
@@ -34,7 +34,7 @@
ControlExample.getResourceString("ListData0_5"), //$NON-NLS-1$
ControlExample.getResourceString("ListData0_6"), //$NON-NLS-1$
ControlExample.getResourceString("ListData0_7")}; //$NON-NLS-1$
-
+
static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"), //$NON-NLS-1$
ControlExample.getResourceString("ListData1_1"), //$NON-NLS-1$
ControlExample.getResourceString("ListData1_2"), //$NON-NLS-1$
@@ -54,7 +54,7 @@
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the sashform widget */
sashFormGroup = new Group (exampleGroup, SWT.NONE);
sashFormGroup.setLayout (new GridLayout ());
@@ -63,13 +63,13 @@
}
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.H_SCROLL;
if (verticalButton.getSelection ()) style |= SWT.V_SCROLL;
if (smoothButton.getSelection ()) style |= SWT.SMOOTH;
-
+
/* Create the example widgets */
form = new SashForm (sashFormGroup, style);
list1 = new List (form, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
@@ -86,7 +86,7 @@
@Override
void createStyleGroup() {
super.createStyleGroup();
-
+
/* Create the extra widgets */
horizontalButton = new Button (styleGroup, SWT.RADIO);
horizontalButton.setText ("SWT.HORIZONTAL");
@@ -98,7 +98,7 @@
smoothButton.setText ("SWT.SMOOTH");
smoothButton.setSelection(false);
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -106,7 +106,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {form};
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -114,7 +114,7 @@
String getTabText () {
return "SashForm"; //$NON-NLS-1$
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java
index a4c0fe8..1dc6692 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SashTab.java
@@ -35,7 +35,7 @@
ControlExample.getResourceString("ListData0_6"),
ControlExample.getResourceString("ListData0_7"),
ControlExample.getResourceString("ListData0_8")};
-
+
static String [] ListData1 = {ControlExample.getResourceString("ListData1_0"),
ControlExample.getResourceString("ListData1_1"),
ControlExample.getResourceString("ListData1_2"),
@@ -56,7 +56,7 @@
SashTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@@ -65,7 +65,7 @@
super.createExampleGroup ();
exampleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
exampleGroup.setLayout(new FillLayout());
-
+
/* Create a group for the sash widgets */
sashGroup = new Group (exampleGroup, SWT.NONE);
FillLayout layout = new FillLayout();
@@ -84,7 +84,7 @@
*/
int style = getDefaultStyle();
sashComp = new Composite(sashGroup, SWT.BORDER | style);
-
+
/* Create the list and text widgets */
list1 = new List (sashComp, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
list1.setItems (ListData0);
@@ -92,12 +92,12 @@
list2.setItems (ListData1);
text = new Text (sashComp, SWT.MULTI | SWT.BORDER);
text.setText (ControlExample.getResourceString("Multi_line"));
-
+
/* Create the sashes */
style = smoothButton.getSelection() ? SWT.SMOOTH : SWT.NONE;
vSash = new Sash (sashComp, SWT.VERTICAL | style);
hSash = new Sash (sashComp, SWT.HORIZONTAL | style);
-
+
/* Add the listeners */
hSash.addSelectionListener (new SelectionAdapter () {
@Override
@@ -133,23 +133,23 @@
* Creates the "Size" group. The "Size" group contains
* controls that allow the user to change the size of
* the example widgets.
- */
+ */
@Override
- void createSizeGroup () {
+ void createSizeGroup () {
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
smoothButton = new Button (styleGroup, SWT.CHECK);
smoothButton.setText("SWT.SMOOTH");
}
-
+
@Override
void disposeExampleWidgets () {
sashComp.dispose();
@@ -163,7 +163,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {hSash, vSash};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -180,21 +180,21 @@
String getTabText () {
return "Sash";
}
-
+
/**
* Layout the list and text widgets according to the new
* positions of the sashes..events.SelectionEvent
*/
void layout () {
-
+
Rectangle clientArea = sashComp.getClientArea ();
Rectangle hSashBounds = hSash.getBounds ();
Rectangle vSashBounds = vSash.getBounds ();
-
+
list1.setBounds (0, 0, vSashBounds.x, hSashBounds.y);
list2.setBounds (vSashBounds.x + vSashBounds.width, 0, clientArea.width - (vSashBounds.x + vSashBounds.width), hSashBounds.y);
text.setBounds (0, hSashBounds.y + hSashBounds.height, clientArea.width, clientArea.height - (hSashBounds.y + hSashBounds.height));
-
+
/**
* If the horizontal sash has been moved then the vertical
* sash is either too long or too short and its size must
@@ -210,7 +210,7 @@
void setExampleWidgetSize () {
sashGroup.layout (true);
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -219,34 +219,34 @@
super.setExampleWidgetState ();
smoothButton.setSelection ((hSash.getStyle () & SWT.SMOOTH) != 0);
}
-
+
/**
* Handle the shell resized event.
*/
void resized () {
-
+
/* Get the client area for the shell */
Rectangle clientArea = sashComp.getClientArea ();
-
+
/*
* Make list 1 half the width and half the height of the tab leaving room for the sash.
* Place list 1 in the top left quadrant of the tab.
*/
Rectangle list1Bounds = new Rectangle (0, 0, (clientArea.width - SASH_WIDTH) / 2, (clientArea.height - SASH_WIDTH) / 2);
list1.setBounds (list1Bounds);
-
+
/*
* Make list 2 half the width and half the height of the tab leaving room for the sash.
* Place list 2 in the top right quadrant of the tab.
*/
list2.setBounds (list1Bounds.width + SASH_WIDTH, 0, clientArea.width - (list1Bounds.width + SASH_WIDTH), list1Bounds.height);
-
+
/*
* Make the text area the full width and half the height of the tab leaving room for the sash.
* Place the text area in the bottom half of the tab.
*/
text.setBounds (0, list1Bounds.height + SASH_WIDTH, clientArea.width, clientArea.height - (list1Bounds.height + SASH_WIDTH));
-
+
/* Position the sashes */
vSash.setBounds (list1Bounds.width, 0, SASH_WIDTH, list1Bounds.height);
hSash.setBounds (0, list1Bounds.height, clientArea.width, SASH_WIDTH);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScaleTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScaleTab.java
index 0b3dd41..9198892 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScaleTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScaleTab.java
@@ -23,7 +23,7 @@
/* Spinner widgets added to the "Control" group */
Spinner incrementSpinner, pageIncrementSpinner;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
@@ -40,50 +40,50 @@
createIncrementGroup ();
createPageIncrementGroup ();
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the scale */
scaleGroup = new Group (exampleGroup, SWT.NONE);
scaleGroup.setLayout (new GridLayout ());
scaleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
scaleGroup.setText ("Scale");
-
+
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL;
if (verticalButton.getSelection ()) style |= SWT.VERTICAL;
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
+
/* Create the example widgets */
scale1 = new Scale (scaleGroup, style);
}
-
+
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
-
+
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
@@ -91,28 +91,28 @@
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
-
+
/* Add the listeners */
incrementSpinner.addSelectionListener (new SelectionAdapter () {
@Override
- public void widgetSelected (SelectionEvent e) {
+ public void widgetSelected (SelectionEvent e) {
setWidgetIncrement ();
}
});
}
-
+
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
-
+
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
@@ -129,7 +129,7 @@
}
});
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -137,7 +137,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {scale1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -154,7 +154,7 @@
String getTabText () {
return "Scale";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -166,7 +166,7 @@
setWidgetPageIncrement ();
}
}
-
+
/**
* Gets the default maximum of the "Example" widgets.
*/
@@ -174,7 +174,7 @@
int getDefaultMaximum () {
return scale1.getMaximum();
}
-
+
/**
* Gets the default minimim of the "Example" widgets.
*/
@@ -182,7 +182,7 @@
int getDefaultMinimum () {
return scale1.getMinimum();
}
-
+
/**
* Gets the default selection of the "Example" widgets.
*/
@@ -197,21 +197,21 @@
int getDefaultIncrement () {
return scale1.getIncrement();
}
-
+
/**
* Gets the default page increment of the "Example" widgets.
*/
int getDefaultPageIncrement () {
return scale1.getPageIncrement();
}
-
+
/**
* Sets the increment of the "Example" widgets.
*/
void setWidgetIncrement () {
scale1.setIncrement (incrementSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -219,7 +219,7 @@
void setWidgetMaximum () {
scale1.setMaximum (maximumSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -227,14 +227,14 @@
void setWidgetMinimum () {
scale1.setMinimum (minimumSpinner.getSelection ());
}
-
+
/**
* Sets the page increment of the "Example" widgets.
*/
void setWidgetPageIncrement () {
scale1.setPageIncrement (pageIncrementSpinner.getSelection ());
}
-
+
/**
* Sets the selection of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java
index 35be1b4..3edd045 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ScrollableTab.java
@@ -15,7 +15,7 @@
import org.eclipse.swt.widgets.*;
abstract class ScrollableTab extends Tab {
- /* Style widgets added to the "Style" group */
+ /* Style widgets added to the "Style" group */
Button singleButton, multiButton, horizontalButton, verticalButton;
/**
@@ -31,7 +31,7 @@
@Override
void createStyleGroup () {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
singleButton = new Button (styleGroup, SWT.RADIO);
singleButton.setText ("SWT.SINGLE");
@@ -46,7 +46,7 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
index 866abfd..cb85a14 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
@@ -23,7 +23,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;
-class ShellTab extends Tab {
+class ShellTab extends Tab {
/* Style widgets added to the "Style" groups, and "Other" group */
Button noParentButton, parentButton;
Button noTrimButton, closeButton, titleButton, minButton, maxButton, borderButton, resizeButton, onTopButton, toolButton, sheetButton, shellTrimButton, dialogTrimButton, noMoveButton;
@@ -35,7 +35,7 @@
/* Variables used to track the open shells */
int shellCount = 0;
Shell [] shells = new Shell [4];
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
@@ -55,14 +55,14 @@
}
shellCount = 0;
}
-
+
/**
* Handle the Create button selection event.
*
* @param event org.eclipse.swt.events.SelectionEvent
*/
public void createButtonSelected(SelectionEvent event) {
-
+
/*
* Remember the example shells so they
* can be disposed by the user.
@@ -72,7 +72,7 @@
System.arraycopy (shells, 0, newShells, 0, shells.length);
shells = newShells;
}
-
+
/* Compute the shell style */
int style = SWT.NONE;
if (noTrimButton.getSelection()) style |= SWT.NO_TRIM;
@@ -90,7 +90,7 @@
if (primaryModalButton.getSelection()) style |= SWT.PRIMARY_MODAL;
if (applicationModalButton.getSelection()) style |= SWT.APPLICATION_MODAL;
if (systemModalButton.getSelection()) style |= SWT.SYSTEM_MODAL;
-
+
/* Create the shell with or without a parent */
if (noParentButton.getSelection ()) {
shells [shellCount] = new Shell (style);
@@ -112,7 +112,7 @@
close.setBounds(160, 20, 120, 30);
close.setText(ControlExample.getResourceString("Close"));
close.addListener(SWT.Selection, event1 -> currentShell.dispose());
-
+
/* Set the size, title, and image, and open the shell */
currentShell.setSize (300, 100);
currentShell.setText (ControlExample.getResourceString("Title") + shellCount);
@@ -122,9 +122,9 @@
currentShell.open ();
shellCount++;
}
-
+
/**
- * Creates the "Control" group.
+ * Creates the "Control" group.
*/
@Override
void createControlGroup () {
@@ -132,23 +132,23 @@
* Create the "Control" group. This is the group on the
* right half of each example tab. It consists of the
* style group, the 'other' group and the size group.
- */
+ */
controlGroup = new Group (tabFolderPage, SWT.NONE);
controlGroup.setLayout (new GridLayout (2, true));
controlGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
controlGroup.setText (ControlExample.getResourceString("Parameters"));
-
+
/* Create a group for the decoration style controls */
styleGroup = new Group (controlGroup, SWT.NONE);
styleGroup.setLayout (new GridLayout ());
styleGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, false, false, 1, 3));
styleGroup.setText (ControlExample.getResourceString("Decoration_Styles"));
-
+
/* Create a group for the modal style controls */
modalStyleGroup = new Group (controlGroup, SWT.NONE);
modalStyleGroup.setLayout (new GridLayout ());
modalStyleGroup.setLayoutData (new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
- modalStyleGroup.setText (ControlExample.getResourceString("Modal_Styles"));
+ modalStyleGroup.setText (ControlExample.getResourceString("Modal_Styles"));
/* Create a group for the 'other' controls */
otherGroup = new Group (controlGroup, SWT.NONE);
@@ -163,19 +163,19 @@
parentStyleGroup.setLayoutData (gridData);
parentStyleGroup.setText (ControlExample.getResourceString("Parent"));
}
-
+
/**
* Creates the "Control" widget children.
*/
@Override
void createControlWidgets () {
-
+
/* Create the parent style buttons */
noParentButton = new Button (parentStyleGroup, SWT.RADIO);
noParentButton.setText (ControlExample.getResourceString("No_Parent"));
parentButton = new Button (parentStyleGroup, SWT.RADIO);
parentButton.setText (ControlExample.getResourceString("Parent"));
-
+
/* Create the decoration style buttons */
noTrimButton = new Button (styleGroup, SWT.CHECK);
noTrimButton.setText ("SWT.NO_TRIM");
@@ -205,7 +205,7 @@
shellTrimButton.setText ("SWT.SHELL_TRIM");
dialogTrimButton = new Button (styleGroup, SWT.CHECK);
dialogTrimButton.setText ("SWT.DIALOG_TRIM");
-
+
/* Create the modal style buttons */
modelessButton = new Button (modalStyleGroup, SWT.RADIO);
modelessButton.setText ("SWT.MODELESS");
@@ -215,15 +215,15 @@
applicationModalButton.setText ("SWT.APPLICATION_MODAL");
systemModalButton = new Button (modalStyleGroup, SWT.RADIO);
systemModalButton.setText ("SWT.SYSTEM_MODAL");
-
+
/* Create the 'other' buttons */
imageButton = new Button (otherGroup, SWT.CHECK);
imageButton.setText (ControlExample.getResourceString("Image"));
backgroundImageButton = new Button(otherGroup, SWT.CHECK);
backgroundImageButton.setText(ControlExample.getResourceString("BackgroundImage"));
-
+
createSetGetGroup();
-
+
/* Create the "create" and "closeAll" buttons */
createButton = new Button (controlGroup, SWT.NONE);
GridData gridData = new GridData (GridData.HORIZONTAL_ALIGN_END);
@@ -233,7 +233,7 @@
gridData = new GridData (GridData.HORIZONTAL_ALIGN_BEGINNING);
closeAllButton.setText (ControlExample.getResourceString("Close_All_Shells"));
closeAllButton.setLayoutData (gridData);
-
+
/* Add the listeners */
createButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -265,12 +265,12 @@
shellTrimButton.addSelectionListener (decorationButtonListener);
applicationModalButton.addSelectionListener (decorationButtonListener);
systemModalButton.addSelectionListener (decorationButtonListener);
-
+
/* Set the default state */
noParentButton.setSelection (true);
modelessButton.setSelection (true);
}
-
+
/**
* Handle a decoration button selection event.
*
@@ -278,9 +278,9 @@
*/
public void decorationButtonSelected(SelectionEvent event) {
Button widget = (Button) event.widget;
-
+
/*
- * Make sure that if the modal style is SWT.APPLICATION_MODAL
+ * Make sure that if the modal style is SWT.APPLICATION_MODAL
* or SWT.SYSTEM_MODAL the style SWT.CLOSE is also selected.
* This is to make sure the user can close the shell.
*/
@@ -288,14 +288,14 @@
if (widget.getSelection()) {
closeButton.setSelection (true);
noTrimButton.setSelection (false);
- }
+ }
return;
}
if (widget == closeButton) {
if (applicationModalButton.getSelection() || systemModalButton.getSelection()) {
closeButton.setSelection (true);
}
- }
+ }
/*
* Make sure that if the SWT.NO_TRIM button is selected
* then all other decoration buttons are deselected.
@@ -316,7 +316,7 @@
noTrimButton.setSelection (false);
}
}
-
+
/*
* Make sure that the SWT.DIALOG_TRIM and SWT.SHELL_TRIM buttons
* are consistent.
@@ -346,7 +346,7 @@
shellTrimButton.setSelection(title && close && min && max && resize && !border);
}
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -354,7 +354,7 @@
String getTabText () {
return "Shell";
}
-
+
@Override
String[] getMethodNames() {
return new String[] {"Alpha", "Bounds", "MinimumSize", "Modified", "Text"};
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java
index 3ec9d83..3ffb032 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SliderTab.java
@@ -23,7 +23,7 @@
/* Spinner widgets added to the "Control" group */
Spinner incrementSpinner, pageIncrementSpinner, thumbSpinner;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
@@ -41,49 +41,49 @@
createIncrementGroup ();
createPageIncrementGroup ();
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the slider */
sliderGroup = new Group (exampleGroup, SWT.NONE);
sliderGroup.setLayout (new GridLayout ());
sliderGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
sliderGroup.setText ("Slider");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection ()) style |= SWT.HORIZONTAL;
if (verticalButton.getSelection ()) style |= SWT.VERTICAL;
if (borderButton.getSelection ()) style |= SWT.BORDER;
-
+
/* Create the example widgets */
slider1 = new Slider(sliderGroup, style);
}
-
+
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
-
+
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
@@ -91,28 +91,28 @@
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
-
+
/* Add the listeners */
incrementSpinner.addSelectionListener (new SelectionAdapter () {
@Override
- public void widgetSelected (SelectionEvent e) {
+ public void widgetSelected (SelectionEvent e) {
setWidgetIncrement ();
}
});
}
-
+
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
-
+
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
@@ -129,19 +129,19 @@
}
});
}
-
+
/**
* Create a group of widgets to control the thumb
* attribute of the example widget.
*/
void createThumbGroup() {
-
+
/* Create the group */
Group thumbGroup = new Group (controlGroup, SWT.NONE);
thumbGroup.setLayout (new GridLayout ());
thumbGroup.setText (ControlExample.getResourceString("Thumb"));
thumbGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
thumbSpinner = new Spinner (thumbGroup, SWT.BORDER);
thumbSpinner.setMaximum (100000);
@@ -158,7 +158,7 @@
}
});
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -166,7 +166,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {slider1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -183,7 +183,7 @@
String getTabText () {
return "Slider";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -196,7 +196,7 @@
setWidgetThumb ();
}
}
-
+
/**
* Gets the default maximum of the "Example" widgets.
*/
@@ -204,7 +204,7 @@
int getDefaultMaximum () {
return slider1.getMaximum();
}
-
+
/**
* Gets the default minimim of the "Example" widgets.
*/
@@ -212,7 +212,7 @@
int getDefaultMinimum () {
return slider1.getMinimum();
}
-
+
/**
* Gets the default selection of the "Example" widgets.
*/
@@ -227,14 +227,14 @@
int getDefaultIncrement () {
return slider1.getIncrement();
}
-
+
/**
* Gets the default page increment of the "Example" widgets.
*/
int getDefaultPageIncrement () {
return slider1.getPageIncrement();
}
-
+
/**
* Gets the default thumb of the "Example" widgets.
*/
@@ -248,7 +248,7 @@
void setWidgetIncrement () {
slider1.setIncrement (incrementSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -256,7 +256,7 @@
void setWidgetMaximum () {
slider1.setMaximum (maximumSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -264,14 +264,14 @@
void setWidgetMinimum () {
slider1.setMinimum (minimumSpinner.getSelection ());
}
-
+
/**
* Sets the page increment of the "Example" widgets.
*/
void setWidgetPageIncrement () {
slider1.setPageIncrement (pageIncrementSpinner.getSelection ());
}
-
+
/**
* Sets the selection of the "Example" widgets.
*/
@@ -279,7 +279,7 @@
void setWidgetSelection () {
slider1.setSelection (selectionSpinner.getSelection ());
}
-
+
/**
* Sets the thumb of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SpinnerTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SpinnerTab.java
index 233aaed..9af6053 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SpinnerTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/SpinnerTab.java
@@ -21,10 +21,10 @@
/* Example widgets and groups that contain them */
Spinner spinner1;
Group spinnerGroup;
-
+
/* Style widgets added to the "Style" group */
Button readOnlyButton, wrapButton;
-
+
/* Spinner widgets added to the "Control" group */
Spinner incrementSpinner, pageIncrementSpinner, digitsSpinner;
@@ -34,7 +34,7 @@
SpinnerTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Control" widget children.
*/
@@ -45,49 +45,49 @@
createPageIncrementGroup ();
createDigitsGroup ();
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the spinner */
spinnerGroup = new Group (exampleGroup, SWT.NONE);
spinnerGroup.setLayout (new GridLayout ());
spinnerGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
spinnerGroup.setText ("Spinner");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (readOnlyButton.getSelection ()) style |= SWT.READ_ONLY;
if (borderButton.getSelection ()) style |= SWT.BORDER;
if (wrapButton.getSelection ()) style |= SWT.WRAP;
-
+
/* Create the example widgets */
spinner1 = new Spinner (spinnerGroup, style);
}
-
+
/**
* Create a group of widgets to control the increment
* attribute of the example widget.
*/
void createIncrementGroup() {
-
+
/* Create the group */
Group incrementGroup = new Group (controlGroup, SWT.NONE);
incrementGroup.setLayout (new GridLayout ());
incrementGroup.setText (ControlExample.getResourceString("Increment"));
incrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
incrementSpinner = new Spinner (incrementGroup, SWT.BORDER);
incrementSpinner.setMaximum (100000);
@@ -95,28 +95,28 @@
incrementSpinner.setPageIncrement (100);
incrementSpinner.setIncrement (1);
incrementSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
-
+
/* Add the listeners */
incrementSpinner.addSelectionListener (new SelectionAdapter () {
@Override
- public void widgetSelected (SelectionEvent e) {
+ public void widgetSelected (SelectionEvent e) {
setWidgetIncrement ();
}
});
}
-
+
/**
* Create a group of widgets to control the page increment
* attribute of the example widget.
*/
void createPageIncrementGroup() {
-
+
/* Create the group */
Group pageIncrementGroup = new Group (controlGroup, SWT.NONE);
pageIncrementGroup.setLayout (new GridLayout ());
pageIncrementGroup.setText (ControlExample.getResourceString("Page_Increment"));
pageIncrementGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
pageIncrementSpinner = new Spinner (pageIncrementGroup, SWT.BORDER);
pageIncrementSpinner.setMaximum (100000);
@@ -133,19 +133,19 @@
}
});
}
-
+
/**
* Create a group of widgets to control the digits
* attribute of the example widget.
*/
void createDigitsGroup() {
-
+
/* Create the group */
Group digitsGroup = new Group (controlGroup, SWT.NONE);
digitsGroup.setLayout (new GridLayout ());
digitsGroup.setText (ControlExample.getResourceString("Digits"));
digitsGroup.setLayoutData (new GridData (GridData.FILL_HORIZONTAL));
-
+
/* Create the Spinner widget */
digitsSpinner = new Spinner (digitsGroup, SWT.BORDER);
digitsSpinner.setMaximum (100000);
@@ -153,16 +153,16 @@
digitsSpinner.setPageIncrement (100);
digitsSpinner.setIncrement (1);
digitsSpinner.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
-
+
/* Add the listeners */
digitsSpinner.addSelectionListener (new SelectionAdapter () {
@Override
- public void widgetSelected (SelectionEvent e) {
+ public void widgetSelected (SelectionEvent e) {
setWidgetDigits ();
}
});
}
-
+
/**
* Creates the tab folder page.
*
@@ -185,7 +185,7 @@
setExampleWidgetSize ();
}
});
-
+
return tabFolderPage;
}
@@ -196,14 +196,14 @@
void createStyleGroup () {
orientationButtons = false;
super.createStyleGroup ();
-
+
/* Create the extra widgets */
readOnlyButton = new Button (styleGroup, SWT.CHECK);
readOnlyButton.setText ("SWT.READ_ONLY");
wrapButton = new Button (styleGroup, SWT.CHECK);
wrapButton.setText ("SWT.WRAP");
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -211,7 +211,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {spinner1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -228,7 +228,7 @@
String getTabText () {
return "Spinner";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -251,7 +251,7 @@
int getDefaultMaximum () {
return spinner1.getMaximum();
}
-
+
/**
* Gets the default minimim of the "Example" widgets.
*/
@@ -259,7 +259,7 @@
int getDefaultMinimum () {
return spinner1.getMinimum();
}
-
+
/**
* Gets the default selection of the "Example" widgets.
*/
@@ -274,14 +274,14 @@
int getDefaultIncrement () {
return spinner1.getIncrement();
}
-
+
/**
* Gets the default page increment of the "Example" widgets.
*/
int getDefaultPageIncrement () {
return spinner1.getPageIncrement();
}
-
+
/**
* Gets the default digits of the "Example" widgets.
*/
@@ -295,7 +295,7 @@
void setWidgetIncrement () {
spinner1.setIncrement (incrementSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -303,7 +303,7 @@
void setWidgetMaximum () {
spinner1.setMaximum (maximumSpinner.getSelection ());
}
-
+
/**
* Sets the minimim of the "Example" widgets.
*/
@@ -311,21 +311,21 @@
void setWidgetMinimum () {
spinner1.setMinimum (minimumSpinner.getSelection ());
}
-
+
/**
* Sets the page increment of the "Example" widgets.
*/
void setWidgetPageIncrement () {
spinner1.setPageIncrement (pageIncrementSpinner.getSelection ());
}
-
+
/**
* Sets the digits of the "Example" widgets.
*/
void setWidgetDigits () {
spinner1.setDigits (digitsSpinner.getSelection ());
}
-
+
/**
* Sets the selection of the "Example" widgets.
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
index 6fe378b..dff3654 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TabFolderTab.java
@@ -26,7 +26,7 @@
/* Example widgets and groups that contain them */
TabFolder tabFolder1;
Group tabFolderGroup;
-
+
/* Style widgets added to the "Style" group */
Button topButton, bottomButton;
@@ -40,27 +40,27 @@
TabFolderTab(ControlExample instance) {
super(instance);
}
-
+
/**
* Creates the "Example" group.
*/
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the TabFolder */
tabFolderGroup = new Group (exampleGroup, SWT.NONE);
tabFolderGroup.setLayout (new GridLayout ());
tabFolderGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
tabFolderGroup.setText ("TabFolder");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (topButton.getSelection ()) style |= SWT.TOP;
@@ -78,14 +78,14 @@
item.setControl(content);
}
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup ();
-
+
/* Create the extra widgets */
topButton = new Button (styleGroup, SWT.RADIO);
topButton.setText ("SWT.TOP");
@@ -95,7 +95,7 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
/**
* Gets the "Example" widget children's items, if any.
*
@@ -105,7 +105,7 @@
Item [] getExampleWidgetItems () {
return tabFolder1.getItems();
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -113,7 +113,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {tabFolder1};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java
index 73bb6d8..f2ce803 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TextTab.java
@@ -24,7 +24,7 @@
/* Style widgets added to the "Style" group */
Button wrapButton, readOnlyButton, passwordButton, searchButton, iconCancelButton, iconSearchButton;
Button leftButton, centerButton, rightButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
@@ -38,20 +38,20 @@
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the text widget */
textGroup = new Group (exampleGroup, SWT.NONE);
textGroup.setLayout (new GridLayout ());
textGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
textGroup.setText ("Text");
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (singleButton.getSelection ()) style |= SWT.SINGLE;
@@ -68,19 +68,19 @@
if (leftButton.getSelection ()) style |= SWT.LEFT;
if (centerButton.getSelection ()) style |= SWT.CENTER;
if (rightButton.getSelection ()) style |= SWT.RIGHT;
-
+
/* Create the example widgets */
text = new Text (textGroup, style);
text.setText (ControlExample.getResourceString("Example_string") + Text.DELIMITER + ControlExample.getResourceString("One_Two_Three"));
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup();
-
+
/* Create the extra widgets */
wrapButton = new Button (styleGroup, SWT.CHECK);
wrapButton.setText ("SWT.WRAP");
@@ -130,7 +130,7 @@
setExampleWidgetSize ();
}
});
-
+
return tabFolderPage;
}
@@ -141,7 +141,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {text};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -158,7 +158,7 @@
String getTabText () {
return "Text";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -172,7 +172,7 @@
leftButton.setSelection ((text.getStyle () & SWT.LEFT) != 0);
centerButton.setSelection ((text.getStyle () & SWT.CENTER) != 0);
rightButton.setSelection ((text.getStyle () & SWT.RIGHT) != 0);
-
+
/* Special case: ICON_CANCEL and H_SCROLL have the same value,
* and ICON_SEARCH and V_SCROLL have the same value,
* so to avoid confusion, only set CANCEL if SEARCH is set. */
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
index f13b8b5..3dac1c5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolBarTab.java
@@ -31,13 +31,13 @@
/* Example widgets and groups that contain them */
ToolBar imageToolBar, textToolBar, imageTextToolBar;
Group imageToolBarGroup, textToolBarGroup, imageTextToolBarGroup;
-
+
/* Style widgets added to the "Style" group */
Button horizontalButton, verticalButton, flatButton, shadowOutButton, wrapButton, rightButton;
/* Other widgets added to the "Other" group */
Button comboChildButton;
-
+
/**
* Creates the Tab within a given instance of ControlExample.
*/
@@ -51,32 +51,32 @@
@Override
void createExampleGroup () {
super.createExampleGroup ();
-
+
/* Create a group for the image tool bar */
imageToolBarGroup = new Group (exampleGroup, SWT.NONE);
imageToolBarGroup.setLayout (new GridLayout ());
imageToolBarGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
imageToolBarGroup.setText (ControlExample.getResourceString("Image_ToolBar"));
-
+
/* Create a group for the text tool bar */
textToolBarGroup = new Group (exampleGroup, SWT.NONE);
textToolBarGroup.setLayout (new GridLayout ());
textToolBarGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
textToolBarGroup.setText (ControlExample.getResourceString("Text_ToolBar"));
-
+
/* Create a group for the image and text tool bar */
imageTextToolBarGroup = new Group (exampleGroup, SWT.NONE);
imageTextToolBarGroup.setLayout (new GridLayout ());
imageTextToolBarGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true));
imageTextToolBarGroup.setText (ControlExample.getResourceString("ImageText_ToolBar"));
}
-
+
/**
* Creates the "Example" widgets.
*/
@Override
void createExampleWidgets () {
-
+
/* Compute the widget style */
int style = getDefaultStyle();
if (horizontalButton.getSelection()) style |= SWT.HORIZONTAL;
@@ -86,14 +86,14 @@
if (borderButton.getSelection()) style |= SWT.BORDER;
if (shadowOutButton.getSelection()) style |= SWT.SHADOW_OUT;
if (rightButton.getSelection()) style |= SWT.RIGHT;
-
+
/*
* Create the example widgets.
*
* A tool bar must consist of all image tool
* items or all text tool items but not both.
*/
-
+
/* Create the image tool bar */
imageToolBar = new ToolBar (imageToolBarGroup, style);
ToolItem item = new ToolItem (imageToolBar, SWT.PUSH);
@@ -131,7 +131,7 @@
item.setImage (instance.images[ControlExample.ciTarget]);
item.setToolTipText ("SWT.DROP_DOWN");
item.addSelectionListener(new DropDownSelectionListener());
-
+
/* Create the text tool bar */
textToolBar = new ToolBar (textToolBarGroup, style);
item = new ToolItem (textToolBar, SWT.PUSH);
@@ -223,18 +223,18 @@
* is selected.
*/
}
-
+
/**
* Creates the "Other" group.
*/
@Override
void createOtherGroup () {
super.createOtherGroup ();
-
+
/* Create display controls specific to this example */
comboChildButton = new Button (otherGroup, SWT.CHECK);
comboChildButton.setText (ControlExample.getResourceString("Combo_child"));
-
+
/* Add the listeners */
comboChildButton.addSelectionListener (new SelectionAdapter () {
@Override
@@ -243,14 +243,14 @@
}
});
}
-
+
/**
* Creates the "Style" group.
*/
@Override
void createStyleGroup() {
super.createStyleGroup();
-
+
/* Create the extra widgets */
horizontalButton = new Button (styleGroup, SWT.RADIO);
horizontalButton.setText ("SWT.HORIZONTAL");
@@ -267,12 +267,12 @@
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
}
-
+
@Override
void disposeExampleWidgets () {
super.disposeExampleWidgets ();
}
-
+
/**
* Gets the "Example" widget children's items, if any.
*
@@ -289,7 +289,7 @@
System.arraycopy(imageTextToolBarItems, 0, allItems, imageToolBarItems.length + textToolBarItems.length, imageTextToolBarItems.length);
return allItems;
}
-
+
/**
* Gets the "Example" widget children.
*/
@@ -297,7 +297,7 @@
Widget [] getExampleWidgets () {
return new Widget [] {imageToolBar, textToolBar, imageTextToolBar};
}
-
+
/**
* Returns a list of set/get API method names (without the set/get prefix)
* that can be used to set/get values in the example control(s).
@@ -322,7 +322,7 @@
String getTabText () {
return "ToolBar";
}
-
+
/**
* Sets the state of the "Example" widgets.
*/
@@ -337,14 +337,14 @@
borderButton.setSelection ((imageToolBar.getStyle () & SWT.BORDER) != 0);
rightButton.setSelection ((imageToolBar.getStyle () & SWT.RIGHT) != 0);
}
-
+
/**
* Listens to widgetSelected() events on SWT.DROP_DOWN type ToolItems
* and opens/closes a menu when appropriate.
*/
class DropDownSelectionListener extends SelectionAdapter {
private Menu menu = null;
-
+
@Override
public void widgetSelected(SelectionEvent event) {
// Create the menu if it has not already been created
@@ -363,13 +363,13 @@
}
}
}
-
+
/**
* A selection event will be fired when a drop down tool
* item is selected in the main area and in the drop
* down arrow. Examine the event detail to determine
* where the widget was selected.
- */
+ */
if (event.detail == SWT.ARROW) {
/*
* The drop down arrow was selected.
@@ -377,11 +377,11 @@
// Position the menu below and vertically aligned with the the drop down tool button.
final ToolItem toolItem = (ToolItem) event.widget;
final ToolBar toolBar = toolItem.getParent();
-
+
Point point = toolBar.toDisplay(new Point(event.x, event.y));
menu.setLocation(point.x, point.y);
menu.setVisible(true);
- }
+ }
}
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
index 7343feb..a836f27 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
@@ -69,23 +69,23 @@
/**
* File Viewer example
*/
-public class FileViewer {
+public class FileViewer {
private static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_fileviewer");
private final static String DRIVE_A = "a:" + File.separator;
private final static String DRIVE_B = "b:" + File.separator;
- /* UI elements */
- private Display display;
+ /* UI elements */
+ private Display display;
private Shell shell;
private ToolBar toolBar;
private Label numObjectsLabel;
private Label diskSpaceLabel;
-
+
private File currentDirectory = null;
private boolean initial = true;
-
+
/* Drag and drop optimizations */
private boolean isDragging = false; // if this app is dragging
private boolean isDropping = false; // if this app is dropping
@@ -172,7 +172,7 @@
/**
* Opens the main program.
*/
- public Shell open(Display display) {
+ public Shell open(Display display) {
// Create the window
this.display = display;
iconCache.initResources(display);
@@ -190,7 +190,7 @@
workerStop();
iconCache.freeResources();
}
-
+
/**
* Returns a string from the resource bundle.
* We don't want to crash because of a missing String.
@@ -203,7 +203,7 @@
return key;
} catch (NullPointerException e) {
return "!" + key + "!";
- }
+ }
}
/**
@@ -223,11 +223,11 @@
/**
* Construct the UI
- *
+ *
* @param container the ShellContainer managing the Shell we are rendering inside
*/
private void createShellContents() {
- shell.setText(getResourceString("Title", new Object[] { "" }));
+ shell.setText(getResourceString("Title", new Object[] { "" }));
shell.setImage(iconCache.stockImages[iconCache.shellIcon]);
Menu bar = new Menu(shell, SWT.BAR);
shell.setMenuBar(bar);
@@ -259,16 +259,16 @@
gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
gridData.widthHint = 185;
numObjectsLabel.setLayoutData(gridData);
-
+
diskSpaceLabel = new Label(shell, SWT.BORDER);
gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
diskSpaceLabel.setLayoutData(gridData);
}
-
+
/**
* Creates the File Menu.
- *
+ *
* @param parent the parent menu
*/
private void createFileMenu(Menu parent) {
@@ -296,10 +296,10 @@
}
});
}
-
+
/**
* Creates the Help Menu.
- *
+ *
* @param parent the parent menu
*/
private void createHelpMenu(Menu parent) {
@@ -309,7 +309,7 @@
header.setMenu(menu);
MenuItem item = new MenuItem(menu, SWT.PUSH);
- item.setText(getResourceString("menu.Help.About.text"));
+ item.setText(getResourceString("menu.Help.About.text"));
item.addSelectionListener(new SelectionAdapter () {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -324,7 +324,7 @@
/**
* Creates the toolbar
- *
+ *
* @param shell the shell on which to attach the toolbar
* @param layoutData the layout data
*/
@@ -397,7 +397,7 @@
/**
* Creates the combo box view.
- *
+ *
* @param parent the parent control
*/
private void createComboView(Composite parent, Object layoutData) {
@@ -427,7 +427,7 @@
/**
* Creates the file tree view.
- *
+ *
* @param parent the parent control
*/
private void createTreeView(Composite parent) {
@@ -452,7 +452,7 @@
if (selection != null && selection.length != 0) {
TreeItem item = selection[0];
File file = (File) item.getData(TREEITEMDATA_FILE);
-
+
notifySelectedDirectory(file);
}
}
@@ -487,7 +487,7 @@
/**
* Creates the Drag & Drop DragSource for items being dragged from the tree.
- *
+ *
* @return the DragSource for the tree
*/
private DragSource createTreeDragSource(final Tree tree){
@@ -517,7 +517,7 @@
public void dragSetData(DragSourceEvent event){
if (dndSelection == null || dndSelection.length == 0) return;
if (! FileTransfer.getInstance().isSupportedType(event.dataType)) return;
-
+
sourceNames = new String[dndSelection.length];
for (int i = 0; i < dndSelection.length; i++) {
File file = (File) dndSelection[i].getData(TREEITEMDATA_FILE);
@@ -531,7 +531,7 @@
/**
* Creates the Drag & Drop DropTarget for items being dropped onto the tree.
- *
+ *
* @return the DropTarget for the tree
*/
private DropTarget createTreeDropTarget(final Tree tree) {
@@ -559,7 +559,7 @@
dropTargetHandleDrop(event, targetFile);
}
private File getTargetFile(DropTargetEvent event) {
- // Determine the target File for the drop
+ // Determine the target File for the drop
TreeItem item = tree.getItem(tree.toControl(new Point(event.x, event.y)));
File targetFile = null;
if (item != null) {
@@ -569,12 +569,12 @@
return targetFile;
}
});
- return dropTarget;
+ return dropTarget;
}
/**
* Handles expand events on a tree item.
- *
+ *
* @param item the TreeItem to fill in
*/
private void treeExpandItem(TreeItem item) {
@@ -583,10 +583,10 @@
if (stub == null) treeRefreshItem(item, true);
shell.setCursor(iconCache.stockCursors[iconCache.cursorDefault]);
}
-
+
/**
* Traverse the entire tree and update only what has changed.
- *
+ *
* @param roots the root directory listing
*/
private void treeRefresh(File[] masterFiles) {
@@ -626,18 +626,18 @@
TreeItem newItem = new TreeItem(tree, SWT.NONE);
treeInitVolume(newItem, masterFile);
new TreeItem(newItem, SWT.NONE); // placeholder child item to get "expand" button
- }
+ }
}
-
+
/**
* Traverse an item in the tree and update only what has changed.
- *
+ *
* @param dirItem the tree item of the directory
* @param forcePopulate true iff we should populate non-expanded items as well
*/
private void treeRefreshItem(TreeItem dirItem, boolean forcePopulate) {
final File dir = (File) dirItem.getData(TREEITEMDATA_FILE);
-
+
if (! forcePopulate && ! dirItem.getExpanded()) {
// Refresh non-expanded item
if (dirItem.getData(TREEITEMDATA_STUB) != null) {
@@ -722,7 +722,7 @@
/**
* Initializes a folder item.
- *
+ *
* @param item the TreeItem to initialize
* @param folder the File associated with this TreeItem
*/
@@ -736,7 +736,7 @@
/**
* Initializes a volume item.
- *
+ *
* @param item the TreeItem to initialize
* @param volume the File associated with this TreeItem
*/
@@ -750,7 +750,7 @@
/**
* Creates the file details table.
- *
+ *
* @param parent the parent control
*/
private void createTableView(Composite parent) {
@@ -784,7 +784,7 @@
private File[] getSelectedFiles() {
final TableItem[] items = table.getSelection();
final File[] files = new File[items.length];
-
+
for (int i = 0; i < items.length; ++i) {
files[i] = (File) items[i].getData(TABLEITEMDATA_FILE);
}
@@ -798,7 +798,7 @@
/**
* Creates the Drag & Drop DragSource for items being dragged from the table.
- *
+ *
* @return the DragSource for the table
*/
private DragSource createTableDragSource(final Table table) {
@@ -826,7 +826,7 @@
public void dragSetData(DragSourceEvent event){
if (dndSelection == null || dndSelection.length == 0) return;
if (! FileTransfer.getInstance().isSupportedType(event.dataType)) return;
-
+
sourceNames = new String[dndSelection.length];
for (int i = 0; i < dndSelection.length; i++) {
File file = (File) dndSelection[i].getData(TABLEITEMDATA_FILE);
@@ -840,7 +840,7 @@
/**
* Creates the Drag & Drop DropTarget for items being dropped onto the table.
- *
+ *
* @return the DropTarget for the table
*/
private DropTarget createTableDropTarget(final Table table){
@@ -868,7 +868,7 @@
dropTargetHandleDrop(event, targetFile);
}
private File getTargetFile(DropTargetEvent event) {
- // Determine the target File for the drop
+ // Determine the target File for the drop
TableItem item = table.getItem(table.toControl(new Point(event.x, event.y)));
File targetFile = null;
if (item == null) {
@@ -889,7 +889,7 @@
/**
* Notifies the application components that a new current directory has been selected
- *
+ *
* @param dir the directory that was selected, null is ignored
*/
void notifySelectedDirectory(File dir) {
@@ -897,7 +897,7 @@
if (currentDirectory != null && dir.equals(currentDirectory)) return;
currentDirectory = dir;
notifySelectedFiles(null);
-
+
/* Shell:
* Sets the title to indicate the selected directory
*/
@@ -913,7 +913,7 @@
*/
final File[] comboRoots = (File[]) combo.getData(COMBODATA_ROOTS);
int comboEntry = -1;
- if (comboRoots != null) {
+ if (comboRoots != null) {
for (int i = 0; i < comboRoots.length; ++i) {
if (dir.equals(comboRoots[i])) {
comboEntry = i;
@@ -960,10 +960,10 @@
}
tree.setSelection((lastItem != null) ? new TreeItem[] { lastItem } : new TreeItem[0]);
}
-
+
/**
* Notifies the application components that files have been selected
- *
+ *
* @param files the files that were selected, null or empty array indicates no active selection
*/
void notifySelectedFiles(File[] files) {
@@ -994,7 +994,7 @@
/**
* Notifies the application components that files must be refreshed
- *
+ *
* @param files the files that need refreshing, empty array is a no-op, null refreshes all
*/
void notifyRefreshFiles(File[] files) {
@@ -1057,7 +1057,7 @@
if (files == null) {
boolean refreshCombo = false;
final File[] comboRoots = (File[]) combo.getData(COMBODATA_ROOTS);
-
+
if ((comboRoots != null) && (comboRoots.length == roots.length)) {
for (int i = 0; i < roots.length; ++i) {
if (! roots[i].equals(comboRoots[i])) {
@@ -1081,7 +1081,7 @@
* Refreshes information about any files in the list and their children.
*/
treeRefresh(roots);
-
+
// Remind everyone where we are in the filesystem
final File dir = currentDirectory;
currentDirectory = null;
@@ -1092,7 +1092,7 @@
/**
* Performs the default action on a set of files.
- *
+ *
* @param files the array of files to process
*/
void doDefaultFileAction(File[] files) {
@@ -1104,7 +1104,7 @@
notifySelectedDirectory(file);
} else {
final String fileName = file.getAbsolutePath();
- if (! Program.launch(fileName)) {
+ if (! Program.launch(fileName)) {
MessageBox dialog = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
dialog.setMessage(getResourceString("error.FailedLaunch.message", new Object[] { fileName }));
dialog.setText(shell.getText ());
@@ -1121,7 +1121,7 @@
File parentDirectory = currentDirectory.getParentFile();
notifySelectedDirectory(parentDirectory);
}
-
+
/**
* Performs a refresh
*/
@@ -1247,7 +1247,7 @@
sourceFiles = new File[sourceNames.length];
for (int i = 0; i < sourceNames.length; ++i)
sourceFiles[i] = new File(sourceNames[i]);
- }
+ }
if (progressDialog == null)
progressDialog = new ProgressDialog(shell, ProgressDialog.MOVE);
progressDialog.setTotalWorkUnits(sourceFiles.length);
@@ -1280,7 +1280,7 @@
/**
* Gets filesystem root entries
- *
+ *
* @return an array of Files corresponding to the root directories on the platform,
* may be empty but not null
*/
@@ -1322,7 +1322,7 @@
/**
* Gets a directory listing
- *
+ *
* @param file the directory to be listed
* @return an array of files this directory contains, may be empty but not null
*/
@@ -1332,24 +1332,24 @@
sortFiles(list);
return list;
}
-
+
/**
* Copies a file or entire directory structure.
- *
+ *
* @param oldFile the location of the old file or directory
* @param newFile the location of the new file or directory
* @return true iff the operation succeeds without errors
*/
boolean copyFileStructure(File oldFile, File newFile) {
if (oldFile == null || newFile == null) return false;
-
+
// ensure that newFile is not a child of oldFile or a dupe
File searchFile = newFile;
do {
if (oldFile.equals(searchFile)) return false;
searchFile = searchFile.getParentFile();
} while (searchFile != null);
-
+
if (oldFile.isDirectory()) {
/*
* Copy a directory
@@ -1391,7 +1391,7 @@
try {
in = new FileReader(oldFile);
out = new FileWriter(newFile);
-
+
int count;
while ((count = in.read()) != -1) out.write(count);
} catch (FileNotFoundException e) {
@@ -1413,12 +1413,12 @@
/**
* Deletes a file or entire directory structure.
- *
+ *
* @param oldFile the location of the old file or directory
* @return true iff the operation succeeds without errors
*/
boolean deleteFileStructure(File oldFile) {
- if (oldFile == null) return false;
+ if (oldFile == null) return false;
if (oldFile.isDirectory()) {
/*
* Delete a directory
@@ -1448,10 +1448,10 @@
}
return oldFile.delete();
}
-
+
/**
* Sorts files lexicographically by name.
- *
+ *
* @param files the array of Files to be sorted
*/
static void sortFiles(File[] files) {
@@ -1464,8 +1464,8 @@
for (int i = end; i > start; --i) {
for (int j = end; j > start; --j) {
if (compareFiles(files[j - 1], files[j]) > 0) {
- final File temp = files[j];
- files[j] = files[j-1];
+ final File temp = files[j];
+ files[j] = files[j-1];
files[j-1] = temp;
}
}
@@ -1497,7 +1497,7 @@
if (compare == 0) compare = a.getName().compareTo(b.getName());
return compare;
}
-
+
/*
* This worker updates the table with file information in the background.
* <p>
@@ -1529,7 +1529,7 @@
/**
* Notifies the worker that it should update itself with new data.
* Cancels any previous operation and begins a new one.
- *
+ *
* @param dir the new base directory for the table, null is ignored
* @param force if true causes a refresh even if the data is the same
*/
@@ -1571,7 +1571,7 @@
// (see workerStop())
display.wake();
};
-
+
/**
* Updates the table's contents
*/
@@ -1585,13 +1585,13 @@
table.setData(TABLEDATA_DIR, workerStateDir);
});
dirList = getDirectoryList(workerStateDir);
-
+
for (int i = 0; (! workerCancelled) && (i < dirList.length); i++) {
workerAddFileDetails(dirList[i]);
}
}
-
+
/**
* Adds a file's detail information to the directory list
*/
@@ -1601,7 +1601,7 @@
final String sizeString;
final String typeString;
final Image iconImage;
-
+
if (file.isDirectory()) {
typeString = getResourceString("filetype.Folder");
sizeString = "";
@@ -1609,7 +1609,7 @@
} else {
sizeString = getResourceString("filesize.KB",
new Object[] { new Long((file.length() + 512) / 1024) });
-
+
int dot = nameString.lastIndexOf('.');
if (dot != -1) {
String extension = nameString.substring(dot);
@@ -1637,7 +1637,7 @@
tableItem.setData(TABLEITEMDATA_FILE, file);
});
}
-
+
/**
* Instances of this class manage a progress dialog for file operations.
*/
@@ -1657,10 +1657,10 @@
"Delete",
"Move"
};
-
+
/**
* Creates a progress dialog but does not open it immediately.
- *
+ *
* @param parent the parent Shell
* @param style one of COPY, MOVE
*/
@@ -1675,21 +1675,21 @@
isCancelled = true;
}
});
-
+
messageLabel = new Label(shell, SWT.HORIZONTAL);
messageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
messageLabel.setText(getResourceString("progressDialog." + operationKeyName[style] + ".description"));
-
+
progressBar = new ProgressBar(shell, SWT.HORIZONTAL | SWT.WRAP);
progressBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
progressBar.setMinimum(0);
progressBar.setMaximum(0);
-
+
detailLabel = new Label(shell, SWT.HORIZONTAL);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
gridData.widthHint = 400;
detailLabel.setLayoutData(gridData);
-
+
cancelButton = new Button(shell, SWT.PUSH);
cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_FILL));
cancelButton.setText(getResourceString("progressDialog.cancelButton.text"));
@@ -1704,7 +1704,7 @@
/**
* Sets the detail text to show the filename along with a string
* representing the operation being performed on that file.
- *
+ *
* @param file the file to be detailed
* @param operation one of COPY, DELETE
*/
@@ -1714,7 +1714,7 @@
}
/**
* Returns true if the Cancel button was been clicked.
- *
+ *
* @return true if the Cancel button was clicked.
*/
public boolean isCancelled() {
@@ -1722,7 +1722,7 @@
}
/**
* Sets the total number of work units to be performed.
- *
+ *
* @param work the total number of work units
*/
public void setTotalWorkUnits(int work) {
@@ -1730,7 +1730,7 @@
}
/**
* Adds to the total number of work units to be performed.
- *
+ *
* @param work the number of work units to add
*/
public void addWorkUnits(int work) {
@@ -1738,7 +1738,7 @@
}
/**
* Sets the progress of completion of the total work units.
- *
+ *
* @param work the total number of work units completed
*/
public void setProgress(int work) {
@@ -1747,7 +1747,7 @@
}
/**
* Adds to the progress of completion of the total work units.
- *
+ *
* @param work the number of work units completed to add
*/
public void addProgress(int work) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java
index 89aa194..4071c17 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/IconCache.java
@@ -63,7 +63,7 @@
"cmd_Search.gif"
};
public Image stockImages[];
-
+
// Stock cursors
public final int
cursorDefault = 0,
@@ -71,18 +71,18 @@
public Cursor stockCursors[];
// Cached icons
private Map<Program, Image> iconCache; /* map Program to Image */
-
+
public IconCache() {
}
/**
* Loads the resources
- *
+ *
* @param display the display
*/
public void initResources(Display display) {
if (stockImages == null) {
stockImages = new Image[stockImageLocations.length];
-
+
for (int i = 0; i < stockImageLocations.length; ++i) {
Image image = createStockImage(display, stockImageLocations[i]);
if (image == null) {
@@ -92,7 +92,7 @@
}
stockImages[i] = image;
}
- }
+ }
if (stockCursors == null) {
stockCursors = new Cursor[] {
null,
@@ -121,7 +121,7 @@
}
/**
* Creates a stock image
- *
+ *
* @param display the display
* @param path the relative path to the icon
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
index f63bfbb..9c16cd0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.swt.examples.graphics;
-/*
+/*
* Drawing with transformations, paths and alpha blending
*
* For a list of all SWT example snippets see
@@ -35,9 +35,9 @@
import org.eclipse.swt.widgets.Shell;
public class AdvancedGraphics {
-
+
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("examples_graphics");
-
+
static Image loadImage (Device device, Class<AdvancedGraphics> clazz, String string) {
InputStream stream = clazz.getResourceAsStream (string);
if (stream == null) return null;
@@ -72,7 +72,7 @@
final Image image = loadImage(display, AdvancedGraphics.class, "irmaos.jpg");
final Rectangle rect = image.getBounds();
shell.addListener(SWT.Paint, event -> {
- GC gc = event.gc;
+ GC gc = event.gc;
Transform tr = new Transform(display);
tr.translate(rect.width / 4, rect.height / 2);
tr.rotate(-30);
@@ -95,10 +95,10 @@
shell.addListener(SWT.Dispose, event -> {
if (image != null) image.dispose();
font.dispose();
- });
+ });
return shell;
}
-
+
public static void main(String[] args) {
Display display = new Display();
Shell shell = new AdvancedGraphics().open(display);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AlphaTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AlphaTab.java
index 6466d40..e966875 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AlphaTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AlphaTab.java
@@ -23,7 +23,7 @@
* Value used in setAlpha API call. Goes from 0 to 255 and then starts over.
*/
int alphaValue;
-
+
/**
* Value used in setAlpha API call. Goes from 0 to 255, then from 255 to 0
* and then starts over.
@@ -32,7 +32,7 @@
boolean reachedMax = false;
int diameter;
-
+
/** random numbers used for positioning "SWT" */
int randX, randY;
Image alphaImg1, alphaImg2;
@@ -40,7 +40,7 @@
public AlphaTab(GraphicsExample example) {
super(example);
}
-
+
@Override
public String getCategory() {
return GraphicsExample.getResourceString("Alpha"); //$NON-NLS-1$
@@ -50,17 +50,17 @@
public String getText() {
return GraphicsExample.getResourceString("Alpha"); //$NON-NLS-1$
}
-
+
@Override
public String getDescription() {
return GraphicsExample.getResourceString("AlphaDescription"); //$NON-NLS-1$
}
-
+
@Override
public int getInitialAnimationTime() {
return 20;
}
-
+
@Override
public void dispose() {
if (alphaImg1 != null) {
@@ -76,20 +76,20 @@
@Override
public void next(int width, int height) {
alphaValue = (alphaValue+5)%255;
-
+
alphaValue2 = reachedMax ? alphaValue2 - 5 : alphaValue2 + 5;
-
+
if (alphaValue2 == 255) {
reachedMax = true;
} else if (alphaValue2 == 0) {
reachedMax = false;
}
-
+
diameter = (diameter + 10)%(width > height ? width : height);
}
- /**
- * Paint the receiver into the specified GC.
+ /**
+ * Paint the receiver into the specified GC.
*/
@Override
public void paint(GC gc, int width, int height) {
@@ -98,28 +98,28 @@
if (alphaImg1 == null) {
alphaImg1 = GraphicsExample.loadImage(device, GraphicsExample.class, "alpha_img1.png");
- alphaImg2 = GraphicsExample.loadImage(device, GraphicsExample.class, "alpha_img2.png");
+ alphaImg2 = GraphicsExample.loadImage(device, GraphicsExample.class, "alpha_img2.png");
}
Rectangle rect = alphaImg1.getBounds();
-
+
gc.setAlpha(alphaValue);
- gc.drawImage(alphaImg1, rect.x, rect.y, rect.width, rect.height,
+ gc.drawImage(alphaImg1, rect.x, rect.y, rect.width, rect.height,
width/2, height/2, width/4, height/4);
-
- gc.drawImage(alphaImg1, rect.x, rect.y, rect.width, rect.height,
+
+ gc.drawImage(alphaImg1, rect.x, rect.y, rect.width, rect.height,
0, 0, width/4, height/4);
gc.setAlpha(255-alphaValue);
- gc.drawImage(alphaImg2, rect.x, rect.y, rect.width, rect.height,
+ gc.drawImage(alphaImg2, rect.x, rect.y, rect.width, rect.height,
width/2, 0, width/4, height/4);
-
- gc.drawImage(alphaImg2, rect.x, rect.y, rect.width, rect.height,
+
+ gc.drawImage(alphaImg2, rect.x, rect.y, rect.width, rect.height,
0, 3*height/4, width/4, height/4);
-
+
// pentagon
gc.setBackground(device.getSystemColor(SWT.COLOR_DARK_MAGENTA));
- gc.fillPolygon(new int [] {width/10, height/2, 3*width/10, height/2-width/6, 5*width/10, height/2,
+ gc.fillPolygon(new int [] {width/10, height/2, 3*width/10, height/2-width/6, 5*width/10, height/2,
4*width/10, height/2+width/6, 2*width/10, height/2+width/6});
gc.setBackground(device.getSystemColor(SWT.COLOR_RED));
@@ -127,45 +127,45 @@
// square
gc.setAlpha(alphaValue);
gc.fillRectangle(width/2, height-75, 75, 75);
-
+
// triangle
gc.setAlpha(alphaValue + 15);
gc.fillPolygon(new int[]{width/2+75, height-(2*75), width/2+75, height-75, width/2+(2*75), height-75});
-
+
// triangle
gc.setAlpha(alphaValue + 30);
gc.fillPolygon(new int[]{width/2+80, height-(2*75), width/2+(2*75), height-(2*75), width/2+(2*75), height-80});
-
+
// triangle
gc.setAlpha(alphaValue + 45);
gc.fillPolygon(new int[]{width/2+(2*75), height-(2*75), width/2+(3*75), height-(2*75), width/2+(3*75), height-(3*75)});
-
+
// triangle
gc.setAlpha(alphaValue + 60);
gc.fillPolygon(new int[]{width/2+(2*75), height-((2*75)+5), width/2+(2*75), height-(3*75), width/2+((3*75)-5), height-(3*75)});
-
+
// square
gc.setAlpha(alphaValue + 75);
gc.fillRectangle(width/2+(3*75), height-(4*75), 75, 75);
-
+
gc.setBackground(device.getSystemColor(SWT.COLOR_GREEN));
-
+
// circle in top right corner
gc.setAlpha(alphaValue2);
gc.fillOval(width-100, 0, 100, 100);
-
+
// triangle
gc.setAlpha(alphaValue + 90);
gc.fillPolygon(new int[]{width-300, 10, width-100, 10, width-275, 50});
-
+
// triangle
gc.setAlpha(alphaValue + 105);
gc.fillPolygon(new int[]{width-10, 100, width-10, 300, width-50, 275});
-
+
// quadrilateral shape
gc.setAlpha(alphaValue + 120);
gc.fillPolygon(new int[]{width-100, 100, width-200, 150, width-200, 200, width-150, 200});
-
+
// blue circles
gc.setBackground(device.getSystemColor(SWT.COLOR_BLUE));
int size = 50;
@@ -179,27 +179,27 @@
}
alpha = alpha + 20;
}
-
+
// SWT string appearing randomly
gc.setAlpha(alphaValue2);
String text = GraphicsExample.getResourceString("SWT");
Font font = createFont(device, 100, SWT.NONE);
gc.setFont(font);
-
+
Point textSize = gc.stringExtent(text);
int textWidth = textSize.x;
int textHeight = textSize.y;
-
+
if (alphaValue2 == 0){
randX = (int)(width*Math.random());
randY = (int)(height*Math.random());
randX = (randX > textWidth) ? randX - textWidth : randX;
randY = (randY > textHeight) ? randY - textHeight : randY;
}
-
+
gc.drawString(text, randX, randY, true);
font.dispose();
-
+
// gray donut
gc.setAlpha(100);
Path path = new Path(device);
@@ -212,11 +212,11 @@
gc.drawPath(path);
path.dispose();
}
-
+
/**
* Creates a font using the specified arguments and returns it.
* This method takes into account the resident platform.
- *
+ *
* @param face
* The name of the font
* @param points
@@ -224,12 +224,12 @@
* @param style
* The style to be applied to the font
*/
- static Font createFont(Device device, int points, int style) {
+ static Font createFont(Device device, int points, int style) {
if(SWT.getPlatform() == "win32") {
- return new Font(device, "Verdana", points, style);
+ return new Font(device, "Verdana", points, style);
} else if (SWT.getPlatform() == "gtk") {
- return new Font(device, "Baekmuk Batang", points, style);
- } else {
+ return new Font(device, "Baekmuk Batang", points, style);
+ } else {
return new Font(device, "Verdana", points, style);
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
index 00b0469..deb4b30 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
@@ -29,7 +29,7 @@
ToolBar toolBar;
ToolItem playItem, pauseItem;
- Spinner timerSpinner; // to input the speed of the animation
+ Spinner timerSpinner; // to input the speed of the animation
private boolean animate; // flag that indicates whether or not to animate the graphic
public AnimatedGraphicsTab(GraphicsExample example) {
@@ -39,29 +39,29 @@
/**
* Sets the layout of the composite to RowLayout and creates the toolbar.
- *
+ *
* @see org.eclipse.swt.examples.graphics.GraphicsTab#createControlPanel(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createControlPanel(Composite parent) {
-
+
// setup layout
RowLayout layout = new RowLayout();
layout.wrap = true;
layout.spacing = 8;
parent.setLayout(layout);
-
+
createToolBar(parent);
}
-
+
/**
* Creates the toolbar controls: play, pause and animation timer.
- *
+ *
* @param parent A composite
*/
void createToolBar(final Composite parent) {
final Display display = parent.getDisplay();
-
+
toolBar = new ToolBar(parent, SWT.FLAT);
Listener toolBarListener = event -> {
switch (event.type) {
@@ -79,19 +79,19 @@
break;
}
};
-
+
// play tool item
playItem = new ToolItem(toolBar, SWT.PUSH);
playItem.setText(GraphicsExample.getResourceString("Play")); //$NON-NLS-1$
playItem.setImage(example.loadImage(display, "play.gif")); //$NON-NLS-1$
playItem.addListener(SWT.Selection, toolBarListener);
-
+
// pause tool item
pauseItem = new ToolItem(toolBar, SWT.PUSH);
pauseItem.setText(GraphicsExample.getResourceString("Pause")); //$NON-NLS-1$
pauseItem.setImage(example.loadImage(display, "pause.gif")); //$NON-NLS-1$
pauseItem.addListener(SWT.Selection, toolBarListener);
-
+
// timer spinner
Composite comp = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
@@ -101,13 +101,13 @@
label.setText(GraphicsExample.getResourceString("Animation")); //$NON-NLS-1$
timerSpinner = new Spinner(comp, SWT.BORDER | SWT.WRAP);
timerSpinner.setMaximum(1000);
-
+
playItem.setEnabled(false);
animate = true;
timerSpinner.setSelection(getInitialAnimationTime());
}
-
+
/**
* Answer whether the receiver's drawing should be double bufferer.
*/
@@ -115,7 +115,7 @@
public boolean getDoubleBuffered() {
return true;
}
-
+
/**
* Gets the initial animation time to be used by the tab. Animation time:
* number of milliseconds between the current drawing and the next (the time
@@ -125,7 +125,7 @@
public int getInitialAnimationTime() {
return 30;
}
-
+
/**
* Gets the animation time that is selected in the spinner. Animation time:
* number of milliseconds between the current drawing and the next (the time
@@ -135,17 +135,17 @@
public int getAnimationTime() {
return timerSpinner.getSelection();
}
-
+
/**
* Returns the true if the tab is currently animated; false otherwise.
*/
public boolean getAnimation() {
return animate;
}
-
+
/**
* Causes the animation to stop or start.
- *
+ *
* @param flag
* true starts the animation; false stops the animation.
*/
@@ -159,5 +159,5 @@
* Advance the animation.
*/
public abstract void next(int width, int height);
-
+
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
index 83f36df..383f012 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
@@ -78,7 +78,7 @@
public String getDescription() {
return GraphicsExample.getResourceString("BallDescription"); //$NON-NLS-1$
}
-
+
@Override
public int getInitialAnimationTime() {
return 10;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BlackHoleTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BlackHoleTab.java
index c9f2536..395b616 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BlackHoleTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BlackHoleTab.java
@@ -14,9 +14,9 @@
import org.eclipse.swt.graphics.*;
public class BlackHoleTab extends AnimatedGraphicsTab {
-
+
int size = 1;
-
+
public BlackHoleTab(GraphicsExample example) {
super(example);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
index 5b37c66..1e4f3e6 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CardsTab.java
@@ -22,7 +22,7 @@
* translation.
*/
public class CardsTab extends AnimatedGraphicsTab {
-
+
float movClubX, movClubY, movDiamondX, movDiamondY, movHeart, movSpade;
float inc_club = 5.0f;
float inc_diamond = 5.0f;
@@ -33,8 +33,8 @@
float scaleArg = 0;
float heartScale = 0.5f;
float spadeScale = 0.333f;
- int clubWidth, diamondWidth, heartWidth, spadeHeight;
-
+ int clubWidth, diamondWidth, heartWidth, spadeHeight;
+
Image ace_club, ace_spade, ace_diamond, ace_hearts;
/**
@@ -80,16 +80,16 @@
// scaleVal goes from 0 to 1, then 1 to 0, then starts over
scaleArg = (float)((scaleArg == 1) ? scaleArg - 0.1 : scaleArg + 0.1);
scale = (float)Math.cos(scaleArg);
-
+
movClubX += inc_club;
movDiamondX += inc_diamond;
movHeart += inc_hearts;
movSpade += inc_spade;
-
+
scaleWidth = (float) ((movClubY/height)*0.35 + 0.15);
movClubY = 2*height/5 * (float)Math.sin(0.01*movClubX - 90) + 2*height/5;
movDiamondY = 2*height/5 * (float)Math.cos(0.01*movDiamondX) + 2*height/5;
-
+
if (movClubX + clubWidth*scaleWidth > width) {
movClubX = width - clubWidth*scaleWidth;
inc_club = -inc_club;
@@ -128,26 +128,26 @@
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
-
+
if (ace_club == null) {
ace_club = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_club.jpg");
ace_spade = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_spade.jpg");
ace_diamond = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_diamond.jpg");
ace_hearts = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_hearts.jpg");
}
-
+
clubWidth = ace_club.getBounds().width;
diamondWidth = ace_diamond.getBounds().width;
heartWidth = ace_hearts.getBounds().width;
spadeHeight = ace_spade.getBounds().height;
Transform transform;
-
- // ace of clubs
+
+ // ace of clubs
transform = new Transform(device);
- transform.translate((int)movClubX, (int)movClubY);
+ transform.translate((int)movClubX, (int)movClubY);
transform.scale(scaleWidth, scaleWidth);
-
+
// rotate on center of image
Rectangle rect = ace_club.getBounds();
transform.translate(rect.width/2, rect.height/2);
@@ -157,7 +157,7 @@
gc.setTransform(transform);
transform.dispose();
gc.drawImage(ace_club, 0, 0);
-
+
// ace of diamonds
transform = new Transform(device);
transform.translate((int)movDiamondX, (int)movDiamondY);
@@ -173,7 +173,7 @@
gc.setTransform(transform);
transform.dispose();
gc.drawImage(ace_hearts, 0, 0);
-
+
// ace of spades
transform = new Transform(device);
transform.translate(movSpade, movSpade);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorListener.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorListener.java
index a72d806..5dfa79d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorListener.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorListener.java
@@ -13,7 +13,7 @@
/**
* Used to perform an action after an item in a Menu has been selected.
- *
+ *
* @see org.eclipse.swt.examples.graphics.ColorMenu.java
* @see org.eclipse.swt.examples.graphics.GraphicsBackground.java
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
index a0c9ba4..4d04e4c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
@@ -39,15 +39,15 @@
public class ColorMenu {
boolean enableColorItems, enablePatternItems, enableGradientItems;
-
+
public ColorMenu() {
enableColorItems = true;
}
-
+
/**
* Method used to specify whether or not the color menu items will appear in
* the menu.
- *
+ *
* @param enable
* A boolean flag - true to make the color menu items visible in
* the menu; false otherwise.
@@ -55,18 +55,18 @@
public void setColorItems(boolean enable) {
enableColorItems = enable;
}
-
+
/**
* @return true if color menu items are contained in the menu; false otherwise.
* */
public boolean getColorItems() {
return enableColorItems;
}
-
+
/**
* Method used to specify whether or not the pattern menu items will appear
* in the menu.
- *
+ *
* @param enable
* A boolean flag - true to make the pattern menu items visible
* in the menu; false otherwise.
@@ -74,18 +74,18 @@
public void setPatternItems(boolean enable) {
enablePatternItems = enable;
}
-
+
/**
* @return true if pattern menu items are contained in the menu; false otherwise.
* */
public boolean getPatternItems() {
return enablePatternItems;
}
-
+
/**
* Method used to specify whether or not the gradient menu items will appear
* in the menu.
- *
+ *
* @param enable
* A boolean flag - true to make the gradient menu items visible
* in the menu; false otherwise.
@@ -93,23 +93,23 @@
public void setGradientItems(boolean enable) {
enableGradientItems = enable;
}
-
+
/**
* @return true if gradient menu items are contained in the menu; false otherwise.
*/
public boolean getGradientItems() {
return enableGradientItems;
}
-
+
/**
* Creates and returns the menu based on the settings provided via
* setColorItems(), setPatternItems() and setGradientItems()
- *
+ *
* @return A menu based on the settings
*/
public Menu createMenu(Control parent, ColorListener cl) {
Menu menu = new Menu(parent);
-
+
MenuItemListener menuItemListener = createMenuItemListener(parent);
menu.addListener(SWT.Selection, menuItemListener);
menu.addListener(SWT.Dispose, menuItemListener);
@@ -126,16 +126,16 @@
}
return menu;
}
-
+
/** Adds the colors items to the menu. */
private void addColorItems(Menu menu, MenuItemListener menuListener,
List<Resource> menuResources) {
Display display = menu.getDisplay();
-
+
if (menu.getItemCount() != 0) {
new MenuItem(menu, SWT.SEPARATOR);
}
-
+
// color names
String[] names = new String[]{
GraphicsExample.getResourceString("White"), //$NON-NLS-1$
@@ -146,7 +146,7 @@
GraphicsExample.getResourceString("Yellow"), //$NON-NLS-1$
GraphicsExample.getResourceString("Cyan"), //$NON-NLS-1$
};
-
+
// colors needed for the background menu
Color[] colors = new Color[]{
display.getSystemColor(SWT.COLOR_WHITE),
@@ -157,7 +157,7 @@
display.getSystemColor(SWT.COLOR_YELLOW),
display.getSystemColor(SWT.COLOR_CYAN),
};
-
+
// add standard color items to menu
for (int i = 0; i < names.length; i++) {
MenuItem item = new MenuItem(menu, SWT.NONE);
@@ -173,59 +173,59 @@
item.setImage(image);
item.setData(gb);
}
-
+
// add custom color item to menu
menuListener.customColorMI = new MenuItem(menu, SWT.NONE);
menuListener.customColorMI.setText(GraphicsExample.getResourceString("CustomColor")); //$NON-NLS-1$
menuListener.customColorMI.addListener(SWT.Selection, menuListener);
GraphicsBackground gb = new GraphicsBackground();
- menuListener.customColorMI.setData(gb);
+ menuListener.customColorMI.setData(gb);
}
-
+
/** Adds the pattern items to the menu. */
private void addPatternItems(Menu menu, MenuItemListener menuListener,
List<Resource> menuResources) {
Display display = menu.getDisplay();
-
+
if (menu.getItemCount() != 0) {
new MenuItem(menu, SWT.SEPARATOR);
}
-
+
// pattern names
String[] names = new String[]{
GraphicsExample.getResourceString("Pattern1"), //$NON-NLS-1$
GraphicsExample.getResourceString("Pattern2"), //$NON-NLS-1$
GraphicsExample.getResourceString("Pattern3"), //$NON-NLS-1$
};
-
+
// pattern images
Image[] images = new Image[]{
- loadImage(display, "pattern1.jpg", menuResources),
+ loadImage(display, "pattern1.jpg", menuResources),
loadImage(display, "pattern2.jpg", menuResources),
loadImage(display, "pattern3.jpg", menuResources),
};
-
+
// add the pre-defined patterns to the menu
for (int i = 0; i < names.length; i++) {
MenuItem item = new MenuItem(menu, SWT.NONE);
item.setText(names[i]);
item.addListener(SWT.Selection, menuListener);
Image image = images[i];
- GraphicsBackground gb = new GraphicsBackground();
+ GraphicsBackground gb = new GraphicsBackground();
gb.setBgImage(image);
gb.setThumbNail(image);
item.setImage(image);
item.setData(gb);
}
-
- // add the custom pattern item
+
+ // add the custom pattern item
menuListener.customPatternMI = new MenuItem(menu, SWT.NONE);
menuListener.customPatternMI.setText(GraphicsExample.getResourceString("CustomPattern")); //$NON-NLS-1$
menuListener.customPatternMI.addListener(SWT.Selection, menuListener);
GraphicsBackground gb = new GraphicsBackground();
- menuListener.customPatternMI.setData(gb);
+ menuListener.customPatternMI.setData(gb);
}
-
+
/** Adds the gradient menu item. */
private void addGradientItems(Menu menu, MenuItemListener menuListener) {
if (menu.getItemCount() != 0) {
@@ -237,15 +237,15 @@
GraphicsBackground gb = new GraphicsBackground();
menuListener.customGradientMI.setData(gb);
}
-
+
/** Creates and returns the listener for menu items. */
private MenuItemListener createMenuItemListener(final Control parent) {
return new MenuItemListener(parent);
}
-
+
/**
* Creates and returns an instance of Image using on the path of an image.
- *
+ *
* @param display
* A Display
* @param name
@@ -270,14 +270,14 @@
GraphicsBackground background; // used to store information about the background
ColorListener colorListener;
List<Resource> resources;
-
+
public MenuItemListener(Control parent){
- this.parent = parent;
+ this.parent = parent;
resources = new ArrayList<>();
}
/**
* Method used to set the ColorListener
- *
+ *
* @param cl
* A ColorListener
* @see org.eclipse.swt.examples.graphics.ColorListener.java
@@ -285,7 +285,7 @@
public void setColorListener(ColorListener cl) {
this.colorListener = cl;
}
-
+
public List<Resource> getMenuResources() {
return resources;
}
@@ -348,8 +348,8 @@
if (background.getBgColor1() != null)
dialog.setFirstRGB(background.getBgColor1().getRGB());
if (background.getBgColor2() != null)
- dialog.setSecondRGB(background.getBgColor2().getRGB());
- }
+ dialog.setSecondRGB(background.getBgColor2().getRGB());
+ }
if (dialog.open() != SWT.OK) return;
Color colorA = new Color(display, dialog.getFirstRGB());
Color colorB = new Color(display, dialog.getSecondRGB());
@@ -358,7 +358,7 @@
if (customPatternMI != null) customPatternMI.setImage(null);
if (customColor != null) customColor.dispose();
if (customImage != null) customImage.dispose();
- customImage = GraphicsExample.createImage(display, colorA,
+ customImage = GraphicsExample.createImage(display, colorA,
colorB, 16, 16);
GraphicsBackground gb = new GraphicsBackground();
gb.setBgImage(customImage);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
index e5c3f6d..c9c48ec 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/FontBounceTab.java
@@ -23,17 +23,17 @@
* as it bounces around the screen.
*/
public class FontBounceTab extends AnimatedGraphicsTab {
-
+
float x, y;
float incX = 10.0f; // units by which to move the word along X axis
- float incY = 5.0f; // units by which to move the word along Y axis
+ float incY = 5.0f; // units by which to move the word along Y axis
int textWidth, textHeight; // width and height of the word SWT
String text = GraphicsExample.getResourceString("SWT");
int fontSize = 100;
- int fontFace = 0;
+ int fontFace = 0;
int foreGrdColor, fillColor; // font colors
int fontStyle; // represents various style attributes applicable to a Font
-
+
public FontBounceTab(GraphicsExample example) {
super(example);
}
@@ -58,14 +58,14 @@
x += incX;
y += incY;
float random = (float)Math.random();
-
- // collision with right side of screen
+
+ // collision with right side of screen
if (x + textWidth > width) {
x = width - textWidth;
incX = random * -width / 16 - 1;
fontFace = 0;
fontSize = 125;
- fillColor = SWT.COLOR_DARK_BLUE;
+ fillColor = SWT.COLOR_DARK_BLUE;
foreGrdColor = SWT.COLOR_YELLOW;
fontStyle = SWT.ITALIC;
}
@@ -106,14 +106,14 @@
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
-
+
Font font = new Font(device, getPlatformFontFace(fontFace), fontSize, fontStyle);
gc.setFont(font);
-
+
Point size = gc.stringExtent(text);
textWidth = size.x;
textHeight = size.y;
-
+
Path path = new Path(device);
path.addString(text, x, y, font);
@@ -129,16 +129,16 @@
/**
* Returns the name of the font using the specified index.
* This method takes into account the resident platform.
- *
+ *
* @param index
* The index of the font to be used
*/
-static String getPlatformFontFace(int index) {
+static String getPlatformFontFace(int index) {
if(SWT.getPlatform() == "win32") {
- return new String [] {"Arial", "Impact", "Times", "Verdana"} [index];
+ return new String [] {"Arial", "Impact", "Times", "Verdana"} [index];
} else if (SWT.getPlatform() == "gtk") {
return new String [] {"URW Chancery L", "Baekmuk Batang", "Baekmuk Headline", "KacsTitleL"} [index];
- } else {
+ } else {
return new String [] {"Arial", "Impact", "Times", "Verdana"} [index];
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsBackground.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsBackground.java
index f699fec..70e541d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsBackground.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsBackground.java
@@ -18,12 +18,12 @@
* This class is used for storing data relevant to a background.
*/
public class GraphicsBackground {
-
+
private Image bgImage;
private Image thumbNail;
private Color bgColor1;
private Color bgColor2;
-
+
public GraphicsBackground() {
bgImage = null;
thumbNail = null;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsTab.java
index 422dadf..f1e0f0d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsTab.java
@@ -19,31 +19,31 @@
* AnimatedGraphicsTab class.
*/
public abstract class GraphicsTab {
-
+
GraphicsExample example;
public GraphicsTab(GraphicsExample example) {
this.example = example;
}
-/**
+/**
* Creates the widgets used to control the drawing.
*/
public void createControlPanel(Composite parent) {
}
-/**
+/**
* Disposes resources created by the receiver.
*/
public void dispose() {
}
-/**
+/**
* Answer the receiver's name.
*/
public abstract String getText();
-/**
+/**
* Answer the receiver's category.
*/
public String getCategory() {
@@ -64,8 +64,8 @@
return false;
}
-/**
- * Paint the receiver into the specified GC.
+/**
+ * Paint the receiver into the specified GC.
*/
public void paint(GC gc, int width, int height) {
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageFlipTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageFlipTab.java
index 57eae8d..e817a5f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageFlipTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageFlipTab.java
@@ -15,7 +15,7 @@
import org.eclipse.swt.graphics.*;
/**
- * This tab demonstrates how an image can be flipped in various fashions.
+ * This tab demonstrates how an image can be flipped in various fashions.
*/
public class ImageFlipTab extends GraphicsTab {
@@ -42,54 +42,54 @@
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
-
+
Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png");
Rectangle bounds = image.getBounds();
-
+
// top
Transform transform = new Transform(device);
transform.translate((width-bounds.width)/2, (height-bounds.height)/2);
transform.scale(1, -1);
gc.setTransform(transform);
-
+
// draw the original image
gc.drawImage(image, 0, 0);
-
+
transform.dispose();
-
+
// bottom
transform = new Transform(device);
transform.translate((width-bounds.width)/2, 2*bounds.height + (height-bounds.height)/2);
transform.scale(1, -1);
gc.setTransform(transform);
-
+
// draw the original image
gc.drawImage(image, 0, 0);
-
+
transform.dispose();
-
+
// left
transform = new Transform(device);
transform.translate((width-bounds.width)/2, (height-bounds.height)/2);
transform.scale(-1, 1);
gc.setTransform(transform);
-
+
// draw the original image
gc.drawImage(image, 0, 0);
-
+
transform.dispose();
-
+
// right
transform = new Transform(device);
transform.translate(2*bounds.width + (width-bounds.width)/2, (height-bounds.height)/2);
transform.scale(-1, 1);
gc.setTransform(transform);
-
+
// draw the original image
gc.drawImage(image, 0, 0);
-
+
transform.dispose();
-
+
gc.setTransform(null);
gc.drawImage(image, (width-bounds.width)/2, (height-bounds.height)/2);
image.dispose();
@@ -100,9 +100,9 @@
*/
static String getPlatformFont() {
if(SWT.getPlatform() == "win32") {
- return "Arial";
+ return "Arial";
} else if (SWT.getPlatform() == "gtk") {
- return "Baekmuk Batang";
+ return "Baekmuk Batang";
} else {
return "Verdana";
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageScaleTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageScaleTab.java
index b37dcab..8c3feb5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageScaleTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageScaleTab.java
@@ -14,7 +14,7 @@
import org.eclipse.swt.graphics.*;
/**
- * This tab demonstrates how an image can be scaled.
+ * This tab demonstrates how an image can be scaled.
*/
public class ImageScaleTab extends GraphicsTab {
@@ -41,11 +41,11 @@
public void paint(GC gc, int width, int height) {
Device device = gc.getDevice();
Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png");
-
+
Rectangle bounds = image.getBounds();
Rectangle canvasBounds = example.canvas.getBounds();
gc.drawImage(image, 0, 0, bounds.width, bounds.height, 0, 0, canvasBounds.width, canvasBounds.height);
-
+
image.dispose();
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
index 6f5b92a..198c475 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
@@ -60,19 +60,19 @@
* This method creates the controls specific to the tab. The call to the
* createControlPanel method in the super class create the controls that are
* defined in the super class.
- *
- * @param parent The parent composite
+ *
+ * @param parent The parent composite
*/
@Override
public void createControlPanel(Composite parent) {
-
+
Composite comp;
GridLayout gridLayout = new GridLayout(2, false);
-
+
// create spinner for the rotation angle
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
-
+
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("Rotate")); //$NON-NLS-1$
rotateSpinner = new Spinner(comp, SWT.BORDER | SWT.WRAP);
GC gc = new GC(rotateSpinner);
@@ -84,11 +84,11 @@
rotateSpinner.setMaximum(720);
rotateSpinner.setIncrement(30);
rotateSpinner.addListener(SWT.Selection, event -> example.redraw());
-
+
// create a spinner for translating along the x axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
-
+
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("xtranslate")); //$NON-NLS-1$
translateSpinnerX = new Spinner(comp, SWT.BORDER | SWT.WRAP);
translateSpinnerX.setLayoutData(new GridData(width, SWT.DEFAULT));
@@ -97,7 +97,7 @@
translateSpinnerX.setSelection(0);
translateSpinnerX.setIncrement(10);
translateSpinnerX.addListener(SWT.Selection, event -> example.redraw());
-
+
// create a spinner for translating along the y axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
@@ -110,11 +110,11 @@
translateSpinnerY.setSelection(0);
translateSpinnerY.setIncrement(10);
translateSpinnerY.addListener(SWT.Selection, event -> example.redraw());
-
+
// create a spinner for scaling along the x axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
-
+
new Label(comp, SWT.CENTER).setText(GraphicsExample.getResourceString("xscale")); //$NON-NLS-1$
scaleSpinnerX = new Spinner(comp, SWT.BORDER | SWT.WRAP);
scaleSpinnerX.setLayoutData(new GridData(width, SWT.DEFAULT));
@@ -124,7 +124,7 @@
scaleSpinnerX.setSelection(100);
scaleSpinnerX.setIncrement(10);
scaleSpinnerX.addListener(SWT.Selection, event -> example.redraw());
-
+
// create a spinner for scaling along the y axis
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
@@ -138,7 +138,7 @@
scaleSpinnerY.setSelection(100);
scaleSpinnerY.setIncrement(10);
scaleSpinnerY.addListener(SWT.Selection, event -> example.redraw());
-
+
// create a button for inverting the transform matrix
comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
@@ -152,26 +152,26 @@
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
- Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_club.jpg");
+ Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "ace_club.jpg");
Transform transform = new Transform(device);
-
+
// scale image
transform.scale(scaleSpinnerX.getSelection()/100f, scaleSpinnerY.getSelection()/100f);
-
+
// translate image
transform.translate(translateSpinnerX.getSelection(), translateSpinnerY.getSelection());
-
+
// rotate on center of image
Rectangle rect = image.getBounds();
transform.translate(rect.width/2, rect.height/2);
transform.rotate(rotateSpinner.getSelection());
transform.translate(-rect.width/2, -rect.height/2);
-
+
if(invertButton.getSelection()){
transform.invert();
}
-
+
gc.setTransform(transform);
gc.drawImage(image, 0, 0);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
index 805b9a3..c645dd4 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
@@ -29,7 +29,7 @@
* images that have been stretched or shrunk.
*/
public class InterpolationTab extends GraphicsTab {
-
+
Combo imageCb; // combo for selecting images
public InterpolationTab(GraphicsExample example) {
@@ -53,11 +53,11 @@
@Override
public void createControlPanel(Composite parent) {
-
+
Composite comp;
GridLayout gridLayout = new GridLayout(2, false);
-
- // create drop down combo
+
+ // create drop down combo
comp = new Composite(parent, SWT.NONE);
comp.setLayout(gridLayout);
new Label(comp, SWT.CENTER).setText(GraphicsExample
@@ -83,7 +83,7 @@
float scaleY = 10f;
Image image = null;
switch (imageCb.getSelectionIndex()) {
-
+
case 0:
image = GraphicsExample.loadImage(device, GraphicsExample.class, "home_nav.gif");
break;
@@ -112,20 +112,20 @@
scaleY = 0.5f;
break;
}
-
+
Rectangle bounds = image.getBounds();
-
+
// draw the original image
- gc.drawImage(image, (width-bounds.width)/2, 20);
-
+ gc.drawImage(image, (width-bounds.width)/2, 20);
+
Font font = new Font(device, getPlatformFont(), 20, SWT.NORMAL);
gc.setFont(font);
-
+
// write some text below the original image
String text = GraphicsExample.getResourceString("OriginalImg"); //$NON-NLS-1$
- Point size = gc.stringExtent(text);
+ Point size = gc.stringExtent(text);
gc.drawString(text, (width-size.x)/2, 25 + bounds.height, true);
-
+
Transform transform = new Transform(device);
transform.translate((width - (bounds.width * scaleX + 10) * 4) / 2, 25 + bounds.height + size.y +
(height - (25 + bounds.height + size.y + bounds.height*scaleY)) / 2);
@@ -134,26 +134,26 @@
// --- draw strings ---
float[] point = new float[2];
text = GraphicsExample.getResourceString("None"); //$NON-NLS-1$
- size = gc.stringExtent(text);
+ size = gc.stringExtent(text);
point[0] = (scaleX*bounds.width + 5 - size.x)/(2*scaleX);
point[1] = bounds.height;
transform.transform(point);
gc.drawString(text, (int)point[0], (int)point[1], true);
-
+
text = GraphicsExample.getResourceString("Low"); //$NON-NLS-1$
size = gc.stringExtent(text);
point[0] = (scaleX*bounds.width + 5 - size.x)/(2*scaleX) + bounds.width;
point[1] = bounds.height;
transform.transform(point);
gc.drawString(text, (int)point[0], (int)point[1], true);
-
+
text = GraphicsExample.getResourceString("Default"); //$NON-NLS-1$
size = gc.stringExtent(text);
point[0] = (scaleX*bounds.width + 5 - size.x)/(2*scaleX) + 2*bounds.width;
point[1] = bounds.height;
transform.transform(point);
gc.drawString(text, (int)point[0], (int)point[1], true);
-
+
text = GraphicsExample.getResourceString("High"); //$NON-NLS-1$
size = gc.stringExtent(text);
point[0] = (scaleX*bounds.width + 5 - size.x)/(2*scaleX) + 3*bounds.width;
@@ -165,11 +165,11 @@
transform.dispose();
// --- draw images ---
-
+
// no interpolation
gc.setInterpolation(SWT.NONE);
gc.drawImage(image, 0, 0);
-
+
// low interpolation
gc.setInterpolation(SWT.LOW);
gc.drawImage(image, bounds.width, 0);
@@ -177,7 +177,7 @@
// default interpolation
gc.setInterpolation(SWT.DEFAULT);
gc.drawImage(image, 2*bounds.width, 0);
-
+
// high interpolation
gc.setInterpolation(SWT.HIGH);
gc.drawImage(image, 3*bounds.width, 0);
@@ -191,9 +191,9 @@
*/
static String getPlatformFont() {
if(SWT.getPlatform() == "win32") {
- return "Arial";
+ return "Arial";
} else if (SWT.getPlatform() == "gtk") {
- return "Baekmuk Batang";
+ return "Baekmuk Batang";
} else {
return "Verdana";
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
index aa26b42..ca66f99 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/IntroTab.java
@@ -16,7 +16,7 @@
import org.eclipse.swt.graphics.*;
public class IntroTab extends AnimatedGraphicsTab {
-
+
Font font;
Image image;
Random random = new Random();
@@ -25,7 +25,7 @@
float incY = 5.0f;
int textWidth, textHeight;
String text = GraphicsExample.getResourceString("SWT");
-
+
public IntroTab(GraphicsExample example) {
super(example);
}
@@ -57,7 +57,7 @@
public void next(int width, int height) {
x += incX;
y += incY;
- float random = (float)Math.random();
+ float random = (float)Math.random();
if (x + textWidth > width) {
x = width - textWidth;
incX = random * -width / 16 - 1;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
index 5126646..74766db 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
@@ -59,11 +59,11 @@
nextCoord.addAll(moveDown(475, 330, 475, 435, 10));
nextCoord.addAll(moveLeft(465, 435, 20, 435, 10));
nextCoord.addAll(moveDown(20, 445, 20, 495, 10));
-
+
nextIndex = 0;
xcoord = nextCoord.get(nextIndex).intValue();
ycoord = nextCoord.get(nextIndex+1).intValue();
-
+
// wrong path 1
nextCoord2 = new ArrayList<>();
nextCoord2.addAll(moveDown(20, -25, 20, 110, 10));
@@ -72,11 +72,11 @@
nextCoord2.addAll(moveRight(140, 15, 520, 15, 10));
nextCoord2.addAll(moveDown(525, 15, 525, 480, 10));
nextCoord2.addAll(moveLeft(515, 480, 70, 480, 10));
-
+
nextIndex2 = 0;
xcoord2 = nextCoord2.get(nextIndex2).intValue();
ycoord2 = nextCoord2.get(nextIndex2+1).intValue();
-
+
// wrong path 2
nextCoord3 = new ArrayList<>();
nextCoord3.addAll(moveDown(20, 0, 20, 110, 10));
@@ -92,11 +92,11 @@
nextCoord3.addAll(moveUp(420, 225, 420, 150, 10));
nextCoord3.addAll(moveLeft(420, 145, 70, 145, 10));
nextCoord3.addAll(moveDown(70, 150, 70, 320, 10));
-
+
nextIndex3 = 0;
xcoord3 = nextCoord3.get(nextIndex3).intValue();
ycoord3 = nextCoord3.get(nextIndex3+1).intValue();
-
+
isDone = isDone2 = isDone3 = false;
}
@@ -131,13 +131,13 @@
@Override
public void createControlPanel(Composite parent) {
super.createControlPanel(parent);
-
- // add selection listener to reset nextNumber after
+
+ // add selection listener to reset nextNumber after
// the sequence has completed
playItem.addListener(SWT.Selection, event -> {
if (isDone){
nextIndex = nextIndex2 = nextIndex3 = 0;
- isDone = isDone2 = isDone3 = false;
+ isDone = isDone2 = isDone3 = false;
}
});
}
@@ -154,7 +154,7 @@
setAnimation(false);
isDone = true;
}
-
+
if (nextIndex2+2 < nextCoord2.size()) {
nextIndex2 = (nextIndex2+2)%nextCoord2.size();
xcoord2 = nextCoord2.get(nextIndex2).intValue();
@@ -162,7 +162,7 @@
} else {
isDone2 = true;
}
-
+
if (nextIndex3+2 < nextCoord3.size()) {
nextIndex3 = (nextIndex3+2)%nextCoord3.size();
xcoord3 = nextCoord3.get(nextIndex3).intValue();
@@ -175,7 +175,7 @@
@Override
public void paint(GC gc, int width, int height) {
Device device = gc.getDevice();
-
+
if (image == null) {
image = example.loadImage(device, "maze.bmp");
}
@@ -184,17 +184,17 @@
int x = (width - bounds.width) / 2;
int y = (height - bounds.height) / 2;
gc.drawImage(image, x, y);
-
+
// draw correct oval
gc.setBackground(device.getSystemColor(SWT.COLOR_RED));
gc.fillOval(x + xcoord, y + ycoord, 16, 16);
gc.drawOval(x + xcoord, y + ycoord, 15, 15);
-
+
// draw wrong oval 1
gc.setBackground(device.getSystemColor(SWT.COLOR_BLUE));
gc.fillOval(x + xcoord2, y + ycoord2, 16, 16);
gc.drawOval(x + xcoord2, y + ycoord2, 15, 15);
-
+
// draw wrong oval 2
gc.setBackground(device.getSystemColor(SWT.COLOR_GREEN));
gc.fillOval(x + xcoord3, y + ycoord3, 16, 16);
@@ -216,7 +216,7 @@
/**
* Returns a list of coordinates moving in a "left-moving" fashion from the start
* point to the end point inclusively.
- *
+ *
* @param x1
* X component of the start point
* @param y1
@@ -245,7 +245,7 @@
/**
* Returns a list of coordinates moving in a "right-moving" fashion from the start
* point to the end point inclusively.
- *
+ *
* @param x1
* X component of the start point
* @param y1
@@ -274,7 +274,7 @@
/**
* Returns a list of coordinates moving in an upward fashion from the start
* point to the end point inclusively.
- *
+ *
* @param x1
* X component of the start point
* @param y1
@@ -303,7 +303,7 @@
/**
* Returns a list of coordinates moving in a downward fashion from the start
* point to the end point inclusively.
- *
+ *
* @param x1
* X component of the start point
* @param y1
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RGBTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RGBTab.java
index ef6375a..4db43e9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RGBTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RGBTab.java
@@ -24,7 +24,7 @@
* colors.
*/
public class RGBTab extends AnimatedGraphicsTab {
-
+
int translateX, translateY;
float diagTranslateX1, diagTranslateX2, diagTranslateY1, diagTranslateY2;
@@ -55,16 +55,16 @@
@Override
public void next(int width, int height) {
-
+
float h = height;
float w = width;
-
+
translateX = (translateX+3)%width;
translateY = (translateY+5)%height;
diagTranslateX1 = (diagTranslateX1+6)%width;
diagTranslateY1 = diagTranslateX1*(h/w);
-
+
diagTranslateX2 = (diagTranslateX2+8)%width;
diagTranslateY2 = -diagTranslateX2*(h/w) + h;
}
@@ -73,16 +73,16 @@
public void paint(GC gc, int width, int height) {
if (!example.checkAdvancedGraphics()) return;
Device device = gc.getDevice();
-
+
// horizontal rectangle
Transform transform = new Transform(device);
transform.translate(0, translateY);
gc.setTransform(transform);
transform.dispose();
-
+
Path path = new Path(device);
path.addRectangle(0, 0, width, 50);
- Pattern pattern = new Pattern(device, 0, 0, width, 50,
+ Pattern pattern = new Pattern(device, 0, 0, width, 50,
device.getSystemColor(SWT.COLOR_BLUE), 0x7f,
device.getSystemColor(SWT.COLOR_RED), 0x7f);
gc.setBackgroundPattern(pattern);
@@ -95,11 +95,11 @@
transform.translate(translateX, 0);
gc.setTransform(transform);
transform.dispose();
-
+
path = new Path(device);
path.addRectangle(0, 0, 50, height);
pattern.dispose();
- pattern = new Pattern(device, 0, 0, 50, height,
+ pattern = new Pattern(device, 0, 0, 50, height,
device.getSystemColor(SWT.COLOR_DARK_CYAN), 0x7f,
device.getSystemColor(SWT.COLOR_WHITE), 0x7f);
gc.setBackgroundPattern(pattern);
@@ -111,40 +111,40 @@
Rectangle rect = new Rectangle(0, 0, 50, height);
transform = new Transform(device);
transform.translate(width-diagTranslateX1, (height/2)-diagTranslateY1);
-
+
// rotate on center of rectangle
transform.translate(rect.width/2, rect.height/2);
transform.rotate(45);
transform.translate(-rect.width/2, -rect.height/2);
gc.setTransform(transform);
transform.dispose();
-
+
path = new Path(device);
path.addRectangle(rect.x, rect.y, rect.width, rect.height);
pattern.dispose();
- pattern = new Pattern(device, rect.x, rect.y, rect.width, rect.height,
+ pattern = new Pattern(device, rect.x, rect.y, rect.width, rect.height,
device.getSystemColor(SWT.COLOR_DARK_GREEN), 0x7f,
device.getSystemColor(SWT.COLOR_DARK_MAGENTA), 0x7f);
gc.setBackgroundPattern(pattern);
gc.fillPath(path);
gc.drawPath(path);
path.dispose();
-
+
// diagonal rectangle from top right corner
transform = new Transform(device);
transform.translate(width-diagTranslateX2, (height/2)-diagTranslateY2);
-
+
// rotate on center of rectangle
transform.translate(rect.width/2, rect.height/2);
transform.rotate(-45);
transform.translate(-rect.width/2, -rect.height/2);
gc.setTransform(transform);
transform.dispose();
-
+
path = new Path(device);
path.addRectangle(rect.x, rect.y, rect.width, rect.height);
pattern.dispose();
- pattern = new Pattern(device, rect.x, rect.y, rect.width, rect.height,
+ pattern = new Pattern(device, rect.x, rect.y, rect.width, rect.height,
device.getSystemColor(SWT.COLOR_DARK_RED), 0x7f,
device.getSystemColor(SWT.COLOR_YELLOW), 0x7f);
gc.setBackgroundPattern(pattern);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ShapesTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ShapesTab.java
index e6b72e7..897e0e4 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ShapesTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ShapesTab.java
@@ -18,10 +18,10 @@
* This tab draws 3D shapes (in 2D) using various line styles.
*/
public class ShapesTab extends AnimatedGraphicsTab {
-
+
int upDownValue;
int inc = 1;
-
+
public ShapesTab(GraphicsExample example) {
super(example);
upDownValue = 0;
@@ -56,147 +56,147 @@
Device device = gc.getDevice();
int size = 100;
-
+
gc.setLineWidth(2);
-
+
// ----- cube -----
-
+
Transform transform = new Transform(device);
transform.translate(width/4 - size, height/4 + -upDownValue);
gc.setTransform(transform);
-
+
gc.setLineStyle(SWT.LINE_DOT);
// fill in left face
gc.setBackground(device.getSystemColor(SWT.COLOR_RED));
gc.fillPolygon(new int [] {0, 0, size/3, -size/2, size/3, size/2, 0, size});
-
+
gc.setLineStyle(SWT.LINE_SOLID);
-
+
// square
gc.drawRectangle(0, 0, size, size);
-
+
// next 3 solid lines
gc.drawLine(0, 0, size/3, -size/2); // left
gc.drawLine(size, 0, 4*size/3, -size/2); // middle
gc.drawLine(size, size, 4*size/3, size/2); // right
-
+
// 2 furthest solid lines
gc.drawLine(size/3, -size/2, 4*size/3, -size/2); // horizontal
gc.drawLine(4*size/3, size/2, 4*size/3, -size/2); // vertical
-
+
// 3 dotted lines
gc.setLineStyle(SWT.LINE_DOT);
gc.drawLine(0, size, size/3, size/2);
gc.drawLine(size/3, -size/2, size/3, size/2);
gc.drawLine(4*size/3, size/2, size/3, size/2);
-
+
// fill right side of cube
gc.setBackground(device.getSystemColor(SWT.COLOR_GRAY));
gc.fillPolygon(new int [] {size, 0, 4*size/3, -size/2, 4*size/3, size/2, size, size});
-
+
transform.dispose();
-
+
// ----- pyramid -----
-
+
transform = new Transform(device);
transform.translate(width/2 + size/2, height/4 + size + upDownValue);
gc.setTransform(transform);
-
+
// fill back of pyramid
gc.fillPolygon(new int [] {size/3, -size/2, 6*size/10, -5*size/4, 4*size/3, -size/2});
-
+
// fill left side of pyramid
gc.setBackground(device.getSystemColor(SWT.COLOR_GREEN));
gc.fillPolygon(new int [] {0, 0, 6*size/10, -5*size/4, size/3, -size/2});
-
+
// select solid line style
gc.setLineStyle(SWT.LINE_SOLID);
-
+
// 2 solid lines of base
gc.drawLine(0, 0, size, 0);
gc.drawLine(size, 0, 4*size/3, -size/2);
-
+
// 3 solid lines of pyramid
gc.drawLine(0, 0, 6*size/10, -5*size/4);
gc.drawLine(size, 0, 6*size/10, -5*size/4);
gc.drawLine(4*size/3, -size/2, 6*size/10, -5*size/4);
-
+
// select dot line style
gc.setLineStyle(SWT.LINE_DOT);
-
+
// 3 dotted lines
- gc.drawLine(0, 0, size/3, -size/2); // left
+ gc.drawLine(0, 0, size/3, -size/2); // left
gc.drawLine(size/3, -size/2, 6*size/10, -5*size/4); // to top of pyramid
gc.drawLine(4*size/3, -size/2, size/3, -size/2); // right
transform.dispose();
-
+
// ----- rectangular prism -----
-
+
transform = new Transform(device);
transform.translate(width/2 + upDownValue, height/2 + size);
gc.setTransform(transform);
-
+
// fill bottom
gc.setBackground(device.getSystemColor(SWT.COLOR_BLUE));
gc.fillPolygon(new int [] {0, size, size/3, size/2, 7*size/3, size/2, 2*size, size});
-
+
// select solid line style
gc.setLineStyle(SWT.LINE_SOLID);
-
+
gc.drawRectangle(0, 0, 2*size, size);
-
+
// next 3 solid lines
gc.drawLine(0, 0, size/3, -size/2); // left
gc.drawLine(2*size, 0, 7*size/3, -size/2); // middle
gc.drawLine(2*size, size, 7*size/3, size/2); // right
-
+
// 2 furthest solid lines
gc.drawLine(size/3, -size/2, 7*size/3, -size/2); // horizontal
gc.drawLine(7*size/3, size/2, 7*size/3, -size/2); // vertical
-
+
// 3 dotted lines
gc.setLineStyle(SWT.LINE_DASHDOTDOT);
gc.drawLine(0, size, size/3, size/2);
gc.drawLine(size/3, -size/2, size/3, size/2);
gc.drawLine(7*size/3, size/2, size/3, size/2);
-
+
// fill top
gc.setBackground(device.getSystemColor(SWT.COLOR_GRAY));
gc.fillPolygon(new int [] {0, 0, size/3, -size/2, 7*size/3, -size/2, 2*size, 0});
transform.dispose();
-
+
// ----- triangular shape -----
transform = new Transform(device);
transform.translate(width/4 - size - upDownValue, height/2 + size + upDownValue);
gc.setTransform(transform);
-
+
// fill back of shape (top left)
gc.setBackground(device.getSystemColor(SWT.COLOR_YELLOW));
gc.fillPolygon(new int [] {0, 0, size/2, -size, size/2, -size/3});
// fill back of shape (bottom right)
gc.fillPolygon(new int [] {size, 0, size/2, size, size/2, -size/3});
-
+
// select solid line style
gc.setLineStyle(SWT.LINE_SOLID);
-
+
// solid lines of bottom triangle
gc.drawLine(0, 0, size/2, size);
gc.drawLine(size, 0, size/2, size);
-
+
// solid lines of top triangle
gc.drawLine(0, 0, size/2, -size);
gc.drawLine(size, 0, size/2, -size);
-
+
// solid lines on top
gc.drawLine(0, 0, size/2, -size/3);
gc.drawLine(size, 0, size/2, -size/3);
gc.drawLine(size/2, -size/3, size/2, size);
gc.drawLine(size/2, -size/3, size/2, -size);
-
+
transform.dispose();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
index 829ab54..16e82c1 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
@@ -19,7 +19,7 @@
public class StarPolyTab extends GraphicsTab {
int[] radial;
static final int POINTS = 11;
-
+
Combo fillRuleCb;
public StarPolyTab(GraphicsExample example) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java
index 1c98dc3..4453ae8 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld1.java
@@ -27,7 +27,7 @@
}
display.dispose ();
}
-
+
public Shell open (Display display) {
Shell shell = new Shell (display);
shell.open ();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java
index 320c8c8..845038e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld2.java
@@ -16,12 +16,12 @@
import java.util.ResourceBundle;
/*
- * This example builds on HelloWorld1 and demonstrates the minimum amount
+ * This example builds on HelloWorld1 and demonstrates the minimum amount
* of code required to open an SWT Shell with a Label and process the events.
*/
public class HelloWorld2 {
private static ResourceBundle resHello = ResourceBundle.getBundle("examples_helloworld");
-
+
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new HelloWorld2 ().open (display);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java
index d96f4fb..9ceea4f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld3.java
@@ -17,12 +17,12 @@
import java.util.ResourceBundle;
/*
- * This example builds on HelloWorld2 and demonstrates how to resize the
+ * This example builds on HelloWorld2 and demonstrates how to resize the
* Label when the Shell resizes using a Listener mechanism.
*/
public class HelloWorld3 {
private static ResourceBundle resHello = ResourceBundle.getBundle("examples_helloworld");
-
+
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new HelloWorld3 ().open (display);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java
index 204f458..757618a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld4.java
@@ -18,12 +18,12 @@
import java.util.ResourceBundle;
/*
- * This example builds on HelloWorld2 and demonstrates how to resize the
+ * This example builds on HelloWorld2 and demonstrates how to resize the
* Label when the Shell resizes using a Layout.
*/
public class HelloWorld4 {
private static ResourceBundle resHello = ResourceBundle.getBundle("examples_helloworld");
-
+
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new HelloWorld4 ().open (display);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
index 55d3da8..c96ac3d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
@@ -39,7 +39,7 @@
public static final int WORD= 0;
public static final int WHITE= 1;
public static final int KEY= 2;
- public static final int COMMENT= 3;
+ public static final int COMMENT= 3;
public static final int STRING= 5;
public static final int OTHER= 6;
public static final int NUMBER= 7;
@@ -81,9 +81,9 @@
tokenColors= new int[MAXIMUM_TOKEN];
tokenColors[WORD]= 0;
tokenColors[WHITE]= 0;
- tokenColors[KEY]= 3;
- tokenColors[COMMENT]= 1;
- tokenColors[STRING]= 2;
+ tokenColors[KEY]= 3;
+ tokenColors[COMMENT]= 1;
+ tokenColors[STRING]= 2;
tokenColors[OTHER]= 0;
tokenColors[NUMBER]= 0;
}
@@ -95,7 +95,7 @@
}
/**
- * Event.detail line start offset (input)
+ * Event.detail line start offset (input)
* Event.text line text (input)
* LineStyleEvent.styles Enumeration of StyleRanges, need to be in order. (output)
* LineStyleEvent.background line background color (output)
@@ -119,8 +119,8 @@
// do nothing for non-colored tokens
} else if (token != WHITE) {
Color color = getColor(token);
- // Only create a style if the token color is different than the
- // widget's default foreground color and the token's style is not
+ // Only create a style if the token color is different than the
+ // widget's default foreground color and the token's style is not
// bold. Keywords are bolded.
if ((!color.equals(defaultFgColor)) || (token == KEY)) {
StyleRange style = new StyleRange(scanner.getStartOffset() + event.lineOffset, scanner.getLength(), color, null);
@@ -135,22 +135,22 @@
if (lastStyle.similarTo(style) && (lastStyle.start + lastStyle.length == style.start)) {
lastStyle.length += style.length;
} else {
- styles.add(style);
+ styles.add(style);
}
- }
- }
+ }
+ }
} else if ((!styles.isEmpty()) && ((lastStyle=styles.get(styles.size()-1)).fontStyle == SWT.BOLD)) {
int start = scanner.getStartOffset() + event.lineOffset;
lastStyle = styles.get(styles.size() - 1);
// A font style of SWT.BOLD implies that the last style
// represents a java keyword.
if (lastStyle.start + lastStyle.length == start) {
- // Have the white space take on the style before it to
+ // Have the white space take on the style before it to
// minimize the number of style ranges created and the
// number of font style changes during rendering.
lastStyle.length += scanner.getLength();
}
- }
+ }
token= scanner.nextToken();
}
event.styles = styles.toArray(new StyleRange[styles.size()]);
@@ -163,7 +163,7 @@
int cnt = 0;
int[] offsets = new int[2];
boolean done = false;
-
+
try {
while (!done) {
switch (ch = buffer.read()) {
@@ -181,10 +181,10 @@
offsets = new int[2];
offsets[0] = cnt;
blkComment = true;
- cnt++;
+ cnt++;
} else {
cnt++;
- }
+ }
cnt++;
break;
}
@@ -193,20 +193,20 @@
ch = buffer.read();
cnt++;
if (ch == '/') {
- blkComment = false;
+ blkComment = false;
offsets[1] = cnt;
blockComments.add(offsets);
}
}
- cnt++;
+ cnt++;
break;
}
default : {
- cnt++;
+ cnt++;
break;
}
}
- }
+ }
} catch(IOException e) {
// ignore errors
}
@@ -225,7 +225,7 @@
protected int fStartToken;
protected boolean fEofSeen= false;
- private String[] fgKeywords= {
+ private String[] fgKeywords= {
"abstract",
"boolean", "break", "byte",
"case", "catch", "char", "class", "continue",
@@ -278,9 +278,9 @@
int c;
fStartToken= fPos;
while (true) {
- switch (c= read()) {
+ switch (c= read()) {
case EOF:
- return EOF;
+ return EOF;
case '/': // comment
c= read();
if (c == '/') {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
index 422c792..0af83e0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
@@ -39,7 +39,7 @@
/**
*/
-public class JavaViewer {
+public class JavaViewer {
Shell shell;
StyledText text;
JavaLineStyler lineStyler = new JavaLineStyler();
@@ -51,7 +51,7 @@
Menu menu = new Menu (bar);
MenuItem item;
- // Open
+ // Open
item = new MenuItem (menu, SWT.PUSH);
item.setText (resources.getString("Open_menuitem"));
item.setAccelerator(SWT.MOD1 + 'O');
@@ -86,7 +86,7 @@
void createShell (Display display) {
shell = new Shell (display);
- shell.setText (resources.getString("Window_title"));
+ shell.setText (resources.getString("Window_title"));
GridLayout layout = new GridLayout();
layout.numColumns = 1;
shell.setLayout(layout);
@@ -136,20 +136,20 @@
return shell;
}
-void openFile() {
+void openFile() {
if (fileDialog == null) {
fileDialog = new FileDialog(shell, SWT.OPEN);
}
fileDialog.setFilterExtensions(new String[] {"*.java", "*.*"});
String name = fileDialog.open();
-
+
open(name);
}
void open(String name) {
final String textString;
-
+
if ((name == null) || (name.length() == 0)) return;
File file = new File(name);
@@ -186,8 +186,8 @@
}
// Guard against superfluous mouse move events -- defer action until later
Display display = text.getDisplay();
- display.asyncExec(() -> text.setText(textString));
-
+ display.asyncExec(() -> text.setText(textString));
+
// parse the block comments up front since block comments can go across
// lines - inefficient way of doing this
lineStyler.parseBlockComments(textString);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java
index 08e3cbd..9f187d6 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FillLayoutTab.java
@@ -29,14 +29,14 @@
Text nameText;
final int NAME_COL = 0;
final int TOTAL_COLS = 2;
-
+
/**
* Creates the Tab within a given instance of LayoutExample.
*/
FillLayoutTab(LayoutExample instance) {
super(instance);
}
-
+
/**
* Creates the widgets in the "child" group.
*/
@@ -44,7 +44,7 @@
void createChildWidgets () {
/* Add common controls */
super.createChildWidgets ();
-
+
/* Add TableEditors */
comboEditor = new TableEditor (table);
nameEditor = new TableEditor (table);
@@ -61,17 +61,17 @@
return;
}
table.showSelection ();
-
+
combo = new CCombo (table, SWT.READ_ONLY);
createComboEditor (combo, comboEditor);
-
+
nameText = new Text(table, SWT.SINGLE);
nameText.setText(data.get(index)[NAME_COL]);
createTextEditor(nameText, nameEditor, NAME_COL);
}
});
}
-
+
/**
* Creates the control widgets.
*/
@@ -90,8 +90,8 @@
vertical = new Button (typeGroup, SWT.RADIO);
vertical.setText ("SWT.VERTICAL");
vertical.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, true, false));
- vertical.addSelectionListener (selectionListener);
-
+ vertical.addSelectionListener (selectionListener);
+
/* Controls the margins and spacing of the FillLayout */
Group marginGroup = new Group(controlGroup, SWT.NONE);
marginGroup.setText (LayoutExample.getResourceString("Margins_Spacing"));
@@ -110,11 +110,11 @@
spacing = new Spinner(marginGroup, SWT.BORDER);
spacing.setSelection(0);
spacing.addSelectionListener(selectionListener);
-
+
/* Add common controls */
super.createControlWidgets ();
}
-
+
/**
* Creates the example layout.
*/
@@ -123,8 +123,8 @@
fillLayout = new FillLayout ();
layoutComposite.setLayout (fillLayout);
}
-
- /**
+
+ /**
* Disposes the editors without placing their contents
* into the table.
*/
@@ -135,7 +135,7 @@
nameText.dispose();
}
-
+
/**
* Generates code for the example layout.
*/
@@ -162,7 +162,7 @@
}
return code;
}
-
+
/**
* Returns the string to insert when a new child control is added to the table.
*/
@@ -178,7 +178,7 @@
String [] getLayoutDataFieldNames() {
return new String [] { "Control Name", "Control Type" };
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -186,7 +186,7 @@
String getTabText () {
return "FillLayout";
}
-
+
/**
* Takes information from TableEditors and stores it.
*/
@@ -196,7 +196,7 @@
comboEditor.setEditor (null, null, -1);
if (oldItem != null) {
int row = table.indexOf (oldItem);
- try {
+ try {
new String (nameText.getText ());
} catch (NumberFormatException e) {
nameText.setText (oldItem.getText (NAME_COL));
@@ -213,7 +213,7 @@
layoutComposite.layout (true);
layoutGroup.layout (true);
}
-
+
/**
* Sets the state of the layout.
*/
@@ -224,10 +224,10 @@
} else {
fillLayout.type = SWT.HORIZONTAL;
}
-
+
/* Set the margins and spacing */
- fillLayout.marginWidth = marginWidth.getSelection();
- fillLayout.marginHeight = marginHeight.getSelection();
+ fillLayout.marginWidth = marginWidth.getSelection();
+ fillLayout.marginHeight = marginHeight.getSelection();
fillLayout.spacing = spacing.getSelection();
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java
index f115539..50d67dd 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/FormLayoutTab.java
@@ -47,7 +47,7 @@
CCombo combo;
Text nameText, widthText, heightText;
Button leftAttach, rightAttach, topAttach, bottomAttach;
-
+
/* Constants */
final int NAME_COL = 0;
final int COMBO_COL = 1;
@@ -57,7 +57,7 @@
final int RIGHT_COL = 5;
final int TOP_COL = 6;
final int BOTTOM_COL = 7;
-
+
final int MODIFY_COLS = 4; // The number of columns with combo or text editors
final int TOTAL_COLS = 8;
@@ -67,7 +67,7 @@
FormLayoutTab(LayoutExample instance) {
super(instance);
}
-
+
/**
* Returns the constant for the alignment for an
* attachment given a string.
@@ -80,7 +80,7 @@
if (align.equals("CENTER")) return SWT.CENTER;
return SWT.DEFAULT;
}
-
+
/**
* Returns a string representing the alignment for an
* attachment given a constant.
@@ -95,10 +95,10 @@
}
return "DEFAULT";
}
-
+
/**
* Update the attachment field in case the type of control
- * has changed.
+ * has changed.
*/
String checkAttachment (String oldAttach, FormAttachment newAttach) {
String controlClass = newAttach.control.getClass().toString ();
@@ -110,7 +110,7 @@
String index = oldAttach.substring (i, oldAttach.indexOf (','));
return controlType + index + "," + newAttach.offset + ":" + alignmentString (newAttach.alignment);
}
-
+
/**
* Creates the widgets in the "child" group.
*/
@@ -118,13 +118,13 @@
void createChildWidgets () {
/* Add common controls */
super.createChildWidgets ();
-
+
/* Resize the columns */
table.getColumn (LEFT_COL).setWidth (90);
table.getColumn (RIGHT_COL).setWidth (90);
table.getColumn (TOP_COL).setWidth (90);
table.getColumn (BOTTOM_COL).setWidth (90);
-
+
/* Add TableEditors */
nameEditor = new TableEditor (table);
comboEditor = new TableEditor (table);
@@ -148,22 +148,22 @@
return;
}
table.showSelection ();
-
+
combo = new CCombo (table, SWT.READ_ONLY);
createComboEditor (combo, comboEditor);
-
+
nameText = new Text (table, SWT.SINGLE);
nameText.setText (data.get(index)[NAME_COL]);
createTextEditor(nameText, nameEditor, NAME_COL);
-
+
widthText = new Text (table, SWT.SINGLE);
widthText.setText (data.get (index) [WIDTH_COL]);
createTextEditor (widthText, widthEditor, WIDTH_COL);
-
+
heightText = new Text (table, SWT.SINGLE);
heightText.setText (data.get (index) [HEIGHT_COL]);
createTextEditor (heightText, heightEditor, HEIGHT_COL);
-
+
leftAttach = new Button (table, SWT.PUSH);
leftAttach.setText (LayoutExample.getResourceString ("Attach_Edit"));
leftEditor.horizontalAlignment = SWT.LEFT;
@@ -182,7 +182,7 @@
resetEditors ();
}
});
-
+
rightAttach = new Button (table, SWT.PUSH);
rightAttach.setText (LayoutExample.getResourceString ("Attach_Edit"));
rightEditor.horizontalAlignment = SWT.LEFT;
@@ -202,7 +202,7 @@
resetEditors ();
}
});
-
+
topAttach = new Button (table, SWT.PUSH);
topAttach.setText (LayoutExample.getResourceString ("Attach_Edit"));
topEditor.horizontalAlignment = SWT.LEFT;
@@ -240,7 +240,7 @@
resetEditors ();
}
});
-
+
for (int i=0; i<table.getColumnCount (); i++) {
Rectangle rect = newItem.getBounds (i);
if (rect.contains (pt)) {
@@ -249,9 +249,9 @@
resetEditors ();
break;
case COMBO_COL :
- combo.setFocus ();
+ combo.setFocus ();
break;
- case WIDTH_COL :
+ case WIDTH_COL :
widthText.setFocus ();
break;
case HEIGHT_COL :
@@ -261,9 +261,9 @@
break;
}
}
- }
+ }
}
- });
+ });
}
/**
@@ -304,11 +304,11 @@
spacing = new Spinner(marginGroup, SWT.BORDER);
spacing.setSelection(0);
spacing.addSelectionListener(selectionListener);
-
+
/* Add common controls */
super.createControlWidgets ();
}
-
+
/**
* Creates the example layout.
*/
@@ -317,8 +317,8 @@
formLayout = new FormLayout ();
layoutComposite.setLayout (formLayout);
}
-
- /**
+
+ /**
* Disposes the editors without placing their contents
* into the table.
*/
@@ -337,7 +337,7 @@
/**
* Generates code for the example layout.
- */
+ */
@Override
StringBuffer generateLayoutCode () {
StringBuffer code = new StringBuffer ();
@@ -364,7 +364,7 @@
code.append ("\t\tformLayout.spacing = " + formLayout.spacing + ";\n");
}
code.append ("\t\tshell.setLayout (formLayout);\n");
-
+
boolean first = true;
for (int i = 0; i < children.length; i++) {
Control control = children [i];
@@ -376,7 +376,7 @@
code.append ("FormData ");
first = false;
}
- code.append ("data = new FormData ();\n");
+ code.append ("data = new FormData ();\n");
if (data.width != SWT.DEFAULT) {
code.append ("\t\tdata.width = " + data.width + ";\n");
}
@@ -432,14 +432,14 @@
}
return code;
}
-
+
/**
* Returns the string to insert when a new child control is added to the table.
*/
@Override
String[] getInsertString (String name, String controlType) {
return new String [] {name, controlType, "-1", "-1",
- "0,0 (" + LayoutExample.getResourceString ("Default") + ")", "",
+ "0,0 (" + LayoutExample.getResourceString ("Default") + ")", "",
"0,0 (" + LayoutExample.getResourceString ("Default") + ")", ""};
}
@@ -450,16 +450,16 @@
String [] getLayoutDataFieldNames() {
return new String [] {
"Control Name",
- "Control Type",
- "width",
- "height",
- "left",
- "right",
- "top",
+ "Control Type",
+ "width",
+ "height",
+ "left",
+ "right",
+ "top",
"bottom"
};
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -467,7 +467,7 @@
String getTabText () {
return "FormLayout";
}
-
+
/**
* Takes information from TableEditors and stores it.
*/
@@ -504,14 +504,14 @@
layoutComposite.layout (true);
layoutGroup.layout (true);
}
-
+
/**
* Return the initial weight of the layout and control groups within the SashForm.
* @return the desired sash weights for the tab page
*/
@Override
int[] sashWeights () {
- return new int[] {40, 60};
+ return new int[] {40, 60};
}
/**
@@ -553,10 +553,10 @@
} catch (NumberFormatException e) {
offset = 0;
}
- return new FormAttachment (position, offset);
+ return new FormAttachment (position, offset);
}
}
-
+
/**
* Sets the layout data for the children of the layout.
*/
@@ -573,7 +573,7 @@
data = new FormData ();
if (width > 0) data.width = width;
if (height > 0) data.height = height;
-
+
left = items [i].getText (LEFT_COL);
if (left.length () > 0) {
data.left = setAttachment (left);
@@ -609,22 +609,22 @@
children [i].setLayoutData (data);
}
}
-
+
/**
* Sets the state of the layout.
*/
@Override
void setLayoutState () {
/* Set the margins and spacing */
- formLayout.marginWidth = marginWidth.getSelection ();
- formLayout.marginHeight = marginHeight.getSelection ();
+ formLayout.marginWidth = marginWidth.getSelection ();
+ formLayout.marginHeight = marginHeight.getSelection ();
formLayout.marginLeft = marginLeft.getSelection ();
formLayout.marginRight = marginRight.getSelection ();
formLayout.marginTop = marginTop.getSelection ();
formLayout.marginBottom = marginBottom.getSelection ();
formLayout.spacing = spacing.getSelection ();
- }
-
+ }
+
/**
* <code>AttachDialog</code> is the class that creates a
* dialog specific for this example. It creates a dialog
@@ -634,25 +634,25 @@
String result = "";
String controlInput, positionInput, alignmentInput, offsetInput;
int col = 0;
-
+
public AttachDialog (Shell parent, int style) {
super (parent, style);
}
-
+
public AttachDialog (Shell parent) {
this (parent, 0);
}
-
+
public void setColumn (int col) {
this.col = col;
}
-
+
public String open () {
Shell parent = getParent ();
final Shell shell = new Shell (parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
shell.setText (getText ());
shell.setLayout (new GridLayout (3, true));
-
+
/* Find out what was previously set as an attachment */
TableItem newItem = leftEditor.getItem ();
result = newItem.getText (col);
@@ -676,18 +676,18 @@
}
}
}
-
+
/* Add position field */
final Button posButton = new Button (shell, SWT.RADIO);
posButton.setText (LayoutExample.getResourceString ("Position"));
- posButton.setSelection (!isControl);
+ posButton.setSelection (!isControl);
final Combo position = new Combo (shell, SWT.NONE);
position.setItems ("0","25","33","50","67","75","100");
position.setVisibleItemCount (7);
position.setText (oldPos);
- position.setEnabled (!isControl);
+ position.setEnabled (!isControl);
position.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
+
/* Add control field */
final Button contButton = new Button (shell, SWT.RADIO);
contButton.setText (LayoutExample.getResourceString ("Control"));
@@ -706,7 +706,7 @@
else control.select (0);
control.setEnabled (isControl);
control.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
+
/* Add alignment field */
new Label (shell, SWT.NONE).setText (LayoutExample.getResourceString ("Alignment"));
final Combo alignment = new Combo (shell, SWT.NONE);
@@ -721,13 +721,13 @@
alignment.setText ("SWT." + oldAlign);
alignment.setEnabled (isControl);
alignment.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
+
/* Add offset field */
new Label (shell, SWT.NONE).setText (LayoutExample.getResourceString ("Offset"));
final Text offset = new Text (shell, SWT.SINGLE | SWT.BORDER);
offset.setText (oldOffset);
offset.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
+
/* Add listeners for choosing between position and control */
posButton.addSelectionListener (new SelectionAdapter () {
@Override
@@ -745,7 +745,7 @@
alignment.setEnabled (true);
}
});
-
+
Button clear = new Button (shell, SWT.PUSH);
clear.setText (LayoutExample.getResourceString ("Clear"));
clear.setLayoutData (new GridData (SWT.END, SWT.CENTER, false, false));
@@ -795,7 +795,7 @@
shell.close ();
}
});
-
+
shell.setDefaultButton (ok);
shell.pack ();
/* Center the dialog */
@@ -807,7 +807,7 @@
while (!shell.isDisposed ()) {
if (display.readAndDispatch ()) display.sleep ();
}
-
+
return result;
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
index 997c511..c2f2158 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/LayoutExample.java
@@ -22,11 +22,11 @@
public class LayoutExample {
private static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_layout");
private TabFolder tabFolder;
-
+
/**
* Creates an instance of a LayoutExample embedded inside
* the supplied parent Composite.
- *
+ *
* @param parent the container of the example
*/
public LayoutExample(Composite parent) {
@@ -44,22 +44,22 @@
item.setControl (tab.createTabFolderPage (tabFolder));
}
}
-
+
/**
* Grabs input focus.
*/
public void setFocus() {
tabFolder.setFocus();
}
-
+
/**
* Disposes of all resources associated with a particular
* instance of the LayoutExample.
- */
+ */
public void dispose() {
tabFolder = null;
}
-
+
/**
* Invokes as a standalone program.
*/
@@ -96,7 +96,7 @@
return key;
} catch (NullPointerException e) {
return "!" + key + "!";
- }
+ }
}
/**
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java
index bb5ec54..dde53d0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/RowLayoutTab.java
@@ -29,7 +29,7 @@
TableEditor comboEditor, widthEditor, heightEditor, nameEditor, excludeEditor;
CCombo combo, exclude;
Text nameText, widthText, heightText;
-
+
/* Constants */
final int NAME_COL = 0;
final int COMBO_COL = 1;
@@ -37,14 +37,14 @@
final int HEIGHT_COL = 3;
final int EXCLUDE_COL = 4;
final int TOTAL_COLS = 5;
-
+
/**
* Creates the Tab within a given instance of LayoutExample.
*/
RowLayoutTab(LayoutExample instance) {
super(instance);
}
-
+
/**
* Creates the widgets in the "child" group.
*/
@@ -52,7 +52,7 @@
void createChildWidgets () {
/* Add common controls */
super.createChildWidgets ();
-
+
/* Add TableEditors */
nameEditor = new TableEditor (table);
comboEditor = new TableEditor (table);
@@ -73,22 +73,22 @@
return;
}
table.showSelection ();
-
+
combo = new CCombo (table, SWT.READ_ONLY);
createComboEditor (combo, comboEditor);
-
+
nameText = new Text(table, SWT.SINGLE);
nameText.setText(data.get(index)[NAME_COL]);
createTextEditor(nameText, nameEditor, NAME_COL);
-
+
widthText = new Text(table, SWT.SINGLE);
widthText.setText(data.get(index)[WIDTH_COL]);
createTextEditor(widthText, widthEditor, WIDTH_COL);
-
+
heightText = new Text(table, SWT.SINGLE);
heightText.setText (data.get (index) [HEIGHT_COL]);
createTextEditor (heightText, heightEditor, HEIGHT_COL);
-
+
String [] boolValues = new String [] {"false", "true"};
exclude = new CCombo (table, SWT.NONE);
exclude.setItems (boolValues);
@@ -106,9 +106,9 @@
case NAME_COL :
nameText.setFocus ();
case COMBO_COL :
- combo.setFocus ();
+ combo.setFocus ();
break;
- case WIDTH_COL :
+ case WIDTH_COL :
widthText.setFocus ();
break;
case HEIGHT_COL :
@@ -122,11 +122,11 @@
break;
}
}
- }
+ }
}
});
}
-
+
/**
* Creates the control widgets.
*/
@@ -139,14 +139,14 @@
typeGroup.setLayoutData(new GridData (SWT.FILL, SWT.FILL, false, false));
horizontal = new Button (typeGroup, SWT.RADIO);
horizontal.setText ("SWT.HORIZONTAL");
- horizontal.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ horizontal.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
horizontal.setSelection(true);
horizontal.addSelectionListener (selectionListener);
vertical = new Button (typeGroup, SWT.RADIO);
vertical.setText ("SWT.VERTICAL");
- vertical.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ vertical.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
vertical.addSelectionListener (selectionListener);
-
+
/* Controls the margins and spacing of the RowLayout */
Group marginGroup = new Group (controlGroup, SWT.NONE);
marginGroup.setText (LayoutExample.getResourceString ("Margins_Spacing"));
@@ -181,7 +181,7 @@
spacing = new Spinner(marginGroup, SWT.BORDER);
spacing.setSelection(3);
spacing.addSelectionListener (selectionListener);
-
+
/* Controls other parameters of the RowLayout */
Group specGroup = new Group (controlGroup, SWT.NONE);
specGroup.setText (LayoutExample.getResourceString ("Properties"));
@@ -190,30 +190,30 @@
wrap = new Button (specGroup, SWT.CHECK);
wrap.setText ("Wrap");
wrap.setSelection (true);
- wrap.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ wrap.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
wrap.addSelectionListener (selectionListener);
pack = new Button (specGroup, SWT.CHECK);
pack.setText ("Pack");
- pack.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ pack.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
pack.setSelection (true);
pack.addSelectionListener(selectionListener);
fill = new Button(specGroup, SWT.CHECK);
fill.setText("Fill");
- fill.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ fill.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fill.addSelectionListener(selectionListener);
justify = new Button (specGroup, SWT.CHECK);
justify.setText ("Justify");
- justify.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ justify.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
justify.addSelectionListener (selectionListener);
center = new Button (specGroup, SWT.CHECK);
center.setText ("Center");
- center.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
+ center.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
center.addSelectionListener (selectionListener);
-
+
/* Add common controls */
super.createControlWidgets ();
}
-
+
/**
* Creates the example layout.
*/
@@ -222,8 +222,8 @@
rowLayout = new RowLayout ();
layoutComposite.setLayout (rowLayout);
}
-
- /**
+
+ /**
* Disposes the editors without placing their contents
* into the table.
*/
@@ -236,10 +236,10 @@
nameText.dispose ();
exclude.dispose ();
}
-
+
/**
* Generates code for the example layout.
- */
+ */
@Override
StringBuffer generateLayoutCode () {
StringBuffer code = new StringBuffer ();
@@ -249,7 +249,7 @@
}
if (rowLayout.wrap == false) {
code.append ("\t\trowLayout.wrap = false;\n");
- }
+ }
if (rowLayout.pack == false) {
code.append ("\t\trowLayout.pack = false;\n");
}
@@ -284,7 +284,7 @@
code.append ("\t\trowLayout.spacing = " + rowLayout.spacing + ";\n");
}
code.append ("\t\tshell.setLayout (rowLayout);\n");
-
+
boolean first = true;
for (int i = 0; i < children.length; i++) {
Control control = children [i];
@@ -304,7 +304,7 @@
} else if (rowData.height == -1) {
code.append ("rowData = new RowData (" + rowData.width + ", SWT.DEFAULT);\n");
} else {
- code.append ("rowData = new RowData (" + rowData.width + ", " + rowData.height + ");\n");
+ code.append ("rowData = new RowData (" + rowData.width + ", " + rowData.height + ");\n");
}
if (rowData.exclude) {
code.append ("\t\trowData.exclude = true;\n");
@@ -315,7 +315,7 @@
}
return code;
}
-
+
/**
* Returns the string to insert when a new child control is added to the table.
*/
@@ -329,15 +329,15 @@
*/
@Override
String [] getLayoutDataFieldNames() {
- return new String [] {
+ return new String [] {
"Control Name",
"Control Type",
- "width",
+ "width",
"height",
"exclude"
};
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -345,7 +345,7 @@
String getTabText () {
return "RowLayout";
}
-
+
/**
* Takes information from TableEditors and stores it.
*/
@@ -355,7 +355,7 @@
if (oldItem != null) {
int row = table.indexOf (oldItem);
/* Make sure user has entered valid data */
- try {
+ try {
new String(nameText.getText());
} catch (NumberFormatException e) {
nameText.setText(oldItem.getText(NAME_COL));
@@ -384,7 +384,7 @@
layoutComposite.layout (true);
layoutGroup.layout (true);
}
-
+
/**
* Sets the layout data for the children of the layout.
*/
@@ -403,9 +403,9 @@
data.exclude = exclude.equals ("true");
children [i].setLayoutData (data);
}
-
+
}
-
+
/**
* Sets the state of the layout.
*/
@@ -413,7 +413,7 @@
void setLayoutState () {
/* Set the type of layout */
rowLayout.type = vertical.getSelection () ? SWT.VERTICAL : SWT.HORIZONTAL;
-
+
/* Set the margins and spacing */
rowLayout.marginWidth = marginWidth.getSelection ();
rowLayout.marginHeight = marginHeight.getSelection ();
@@ -422,7 +422,7 @@
rowLayout.marginTop = marginTop.getSelection ();
rowLayout.marginBottom = marginBottom.getSelection ();
rowLayout.spacing = spacing.getSelection ();
-
+
/* Set the other layout properties */
rowLayout.wrap = wrap.getSelection ();
rowLayout.pack = pack.getSelection ();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
index 4c9e99d..c6eba0c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/StackLayoutTab.java
@@ -30,14 +30,14 @@
Text nameText;
final int NAME_COL = 0;
final int TOTAL_COLS = 2;
-
+
/**
* Creates the Tab within a given instance of LayoutExample.
*/
StackLayoutTab(LayoutExample instance) {
super(instance);
}
-
+
/**
* Creates the widgets in the "child" group.
*/
@@ -45,36 +45,36 @@
void createChildWidgets() {
/* Add common controls */
super.createChildWidgets();
-
+
/* Add TableEditors */
comboEditor = new TableEditor(table);
nameEditor = new TableEditor(table);
table.addMouseListener (new MouseAdapter() {
@Override
- public void mouseDown(MouseEvent e) {
+ public void mouseDown(MouseEvent e) {
resetEditors();
index = table.getSelectionIndex();
if (index == -1) return;
//set top layer of stack to the selected item
setTopControl (index);
-
+
TableItem oldItem = comboEditor.getItem();
newItem = table.getItem(index);
if (newItem == oldItem || newItem != lastSelected) {
lastSelected = newItem;
return;
}
- table.showSelection();
- combo = new CCombo(table, SWT.READ_ONLY);
+ table.showSelection();
+ combo = new CCombo(table, SWT.READ_ONLY);
createComboEditor(combo, comboEditor);
-
+
nameText = new Text(table, SWT.SINGLE);
nameText.setText(data.get(index)[NAME_COL]);
createTextEditor(nameText, nameEditor, NAME_COL);
}
- });
+ });
}
-
+
/**
* Creates the control widgets.
*/
@@ -105,7 +105,7 @@
public void widgetSelected(SelectionEvent e) {
setTopControl (currentLayer + 1);
}
- });
+ });
/* Controls the margins of the StackLayout */
Group marginGroup = new Group(controlGroup, SWT.NONE);
@@ -121,11 +121,11 @@
marginHeight.setSelection(0);
marginHeight.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
marginHeight.addSelectionListener(selectionListener);
-
+
/* Add common controls */
super.createControlWidgets();
}
-
+
/**
* Creates the example layout.
*/
@@ -134,15 +134,15 @@
stackLayout = new StackLayout();
layoutComposite.setLayout(stackLayout);
}
-
+
@Override
void createLayoutComposite() {
layoutComposite = new Composite(layoutGroup, SWT.BORDER);
layoutComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
createLayout();
}
-
- /**
+
+ /**
* Disposes the editors without placing their contents
* into the table.
*/
@@ -152,7 +152,7 @@
combo.dispose();
nameText.dispose();
}
-
+
/**
* Generates code for the example layout.
*/
@@ -176,7 +176,7 @@
}
return code;
}
-
+
@Override
boolean needsCustom() {
return true;
@@ -197,7 +197,7 @@
String[] getLayoutDataFieldNames() {
return new String[] {"Control Name", "Control Type"};
}
-
+
/**
* Gets the text for the tab folder item.
*/
@@ -205,7 +205,7 @@
String getTabText() {
return "StackLayout";
}
-
+
/**
* Takes information from TableEditors and stores it.
*/
@@ -215,7 +215,7 @@
comboEditor.setEditor (null, null, -1);
if (oldItem != null) {
int row = table.indexOf (oldItem);
- try {
+ try {
new String (nameText.getText ());
} catch (NumberFormatException e) {
nameText.setText (oldItem.getText (NAME_COL));
@@ -231,7 +231,7 @@
refreshLayoutComposite ();
setTopControl (currentLayer);
layoutGroup.layout (true);
- }
+ }
void setTopControl (int index) {
if (index == -1 || children.length == 0) {
@@ -254,9 +254,9 @@
@Override
void setLayoutState() {
/* Set the margins and spacing */
- stackLayout.marginWidth = marginWidth.getSelection();
- stackLayout.marginHeight = marginHeight.getSelection();
- }
-
+ stackLayout.marginWidth = marginWidth.getSelection();
+ stackLayout.marginHeight = marginHeight.getSelection();
+ }
+
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
index 2a2367e..ada9224 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
@@ -23,10 +23,10 @@
private Random random;
private int cachedRadiusSquared;
private int cachedNumPoints;
-
+
/**
* Constructs a Tool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -36,10 +36,10 @@
setRetriggerTimer(10);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
@@ -54,7 +54,7 @@
/**
* Returns the name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
index 08603da..e385dd9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
@@ -19,7 +19,7 @@
/**
* Constructs a PaintSession.
- *
+ *
* @param paintSurface the drawing surface to use
*/
protected BasicPaintSession(PaintSurface paintSurface) {
@@ -28,7 +28,7 @@
/**
* Returns the paint surface associated with this paint session.
- *
+ *
* @return the associated PaintSurface
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContainerFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContainerFigure.java
index 5300b53..483940c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContainerFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContainerFigure.java
@@ -18,7 +18,7 @@
*/
public class ContainerFigure extends Figure {
private static final int INITIAL_ARRAY_SIZE = 16;
-
+
Figure[] objectStack = null;
int nextIndex = 0;
@@ -29,7 +29,7 @@
}
/**
* Adds an object to the container for later drawing.
- *
+ *
* @param object the object to add to the drawing list
*/
public void add(Figure object) {
@@ -52,7 +52,7 @@
}
/**
* Adds an object to the container and draws its preview then updates the supplied preview state.
- *
+ *
* @param object the object to add to the drawing list
* @param gc the GC to draw on
* @param offset the offset to add to virtual coordinates to get display coordinates
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
index 0d9bd25..48041ea 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
@@ -24,7 +24,7 @@
* True if a click-drag is in progress.
*/
private boolean dragInProgress = false;
-
+
/**
* A cached Point array for drawing.
*/
@@ -34,7 +34,7 @@
* The time to wait between retriggers in milliseconds.
*/
private int retriggerInterval = 0;
-
+
/**
* The currently valid RetriggerHandler
*/
@@ -42,7 +42,7 @@
/**
* Constructs a ContinuousPaintSession.
- *
+ *
* @param paintSurface the drawing surface to use
*/
protected ContinuousPaintSession(PaintSurface paintSurface) {
@@ -70,7 +70,7 @@
setStatusMessage(PaintExample.getResourceString("session.ContinuousPaint.message"));
dragInProgress = false;
}
-
+
/**
* Deactivates the tool.
*/
@@ -78,7 +78,7 @@
public void endSession() {
abortRetrigger();
}
-
+
/**
* Aborts the current operation.
*/
@@ -89,7 +89,7 @@
/**
* Handles a mouseDown event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -106,7 +106,7 @@
/**
* Handles a mouseDoubleClick event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -115,7 +115,7 @@
/**
* Handles a mouseUp event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -126,10 +126,10 @@
mouseSegmentFinished(event);
dragInProgress = false;
}
-
+
/**
* Handles a mouseMove event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -140,10 +140,10 @@
mouseSegmentFinished(event);
prepareRetrigger();
}
-
+
/**
* Handle a rendering segment
- *
+ *
* @param event the mouse event detail information
*/
private final void mouseSegmentFinished(MouseEvent event) {
@@ -159,7 +159,7 @@
/**
* Draws a continuous segment from points[0] to points[1].
* Assumes points[0] has been drawn already.
- *
+ *
* @post points[0] will refer to the same point as points[1]
*/
protected void renderContinuousSegment() {
@@ -170,7 +170,7 @@
int absdY = Math.abs(dY);
if ((dX == 0) && (dY == 0)) return;
-
+
if (absdY > absdX) {
final int incfpX = (dX << 16) / absdY;
final int incY = (dY > 0) ? 1 : -1;
@@ -197,7 +197,7 @@
points[0].y = points[1].y;
}
render(points[0]);
- }
+ }
/**
* Prepare the retrigger timer
@@ -222,7 +222,7 @@
prepareRetrigger();
}
}
- };
+ };
display.timerExec(retriggerInterval, retriggerHandler);
}
}
@@ -233,7 +233,7 @@
private final void abortRetrigger() {
retriggerHandler = null;
}
-
+
/**
* Template method: Renders a point.
* @param point, the point to render
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
index 205541d..b0d1fd2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
@@ -23,7 +23,7 @@
* True if a click-drag is in progress
*/
private boolean dragInProgress = false;
-
+
/**
* The position of the first click in a click-drag
*/
@@ -33,10 +33,10 @@
* A temporary point
*/
private Point tempPosition = new Point(-1, -1);
-
+
/**
* Constructs a PaintSession.
- *
+ *
* @param getPaintSurface() the drawing surface to use
*/
protected DragPaintSession(PaintSurface paintSurface) {
@@ -53,14 +53,14 @@
anchorPosition.x = -1;
dragInProgress = false;
}
-
+
/**
* Deactivates the tool.
*/
@Override
public void endSession() {
}
-
+
/**
* Resets the tool.
* Aborts any operation in progress.
@@ -74,7 +74,7 @@
/**
* Handles a mouseDown event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -82,14 +82,14 @@
if (event.button != 1) return;
if (dragInProgress) return; // spurious event
dragInProgress = true;
-
+
anchorPosition.x = event.x;
anchorPosition.y = event.y;
}
/**
* Handles a mouseDoubleClick event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -98,7 +98,7 @@
/**
* Handles a mouseUp event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -110,13 +110,13 @@
if (! dragInProgress) return; // spurious event
dragInProgress = false;
if (anchorPosition.x == -1) return; // spurious event
-
+
getPaintSurface().commitRubberbandSelection();
}
-
+
/**
* Handles a mouseMove event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -132,10 +132,10 @@
tempPosition.y = event.y;
ps.addRubberbandSelection(createFigure(anchorPosition, tempPosition));
}
-
+
/**
* Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
+ *
* @param anchor the anchor point
* @param cursor the point marking the current pointer location
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseFigure.java
index c8ac193..bf4102e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseFigure.java
@@ -24,7 +24,7 @@
* Constructs an Ellipse
* These objects are defined by any two diametrically opposing corners of a box
* bounding the ellipse.
- *
+ *
* @param color the color for this object
* @param lineStyle the line style for this object
* @param x1 the virtual X coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
index 47a3e6b..75ca867 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
@@ -21,7 +21,7 @@
/**
* Constructs a EllipseTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -32,7 +32,7 @@
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
@@ -42,7 +42,7 @@
/**
* Returns name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Figure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Figure.java
index 7fce7e6..36a6d9f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Figure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Figure.java
@@ -22,7 +22,7 @@
public abstract class Figure {
/**
* Draws this object.
- *
+ *
* @param fdc a parameter block specifying drawing-related information
*/
public abstract void draw(FigureDrawContext fdc);
@@ -30,7 +30,7 @@
/**
* Computes the damaged screen region caused by drawing this object (imprecise), then
* appends it to the supplied region.
- *
+ *
* @param fdc a parameter block specifying drawing-related information
* @param region a region to which additional damage areas will be added
*/
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/FigureDrawContext.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/FigureDrawContext.java
index c4ab18d..a5a96f2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/FigureDrawContext.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/FigureDrawContext.java
@@ -26,7 +26,7 @@
public GC gc = null;
public int xOffset = 0, yOffset = 0; // substract to get GC coords
public int xScale = 1, yScale = 1;
-
+
public Rectangle toClientRectangle(int x1, int y1, int x2, int y2) {
return new Rectangle(
Math.min(x1, x2) * xScale - xOffset,
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineFigure.java
index 292cd29..0624ad2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineFigure.java
@@ -23,7 +23,7 @@
/**
* Constructs a Line
* These objects are defined by their two end-points.
- *
+ *
* @param color the color for this object
* @param lineStyle the line style for this object
* @param x1 the virtual X coordinate of the first end-point
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
index 6d5a050..9ef0c51 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
@@ -21,7 +21,7 @@
/**
* Constructs a LineTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -29,20 +29,20 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
-
+
/**
* Returns name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
index e37b8fe..1594541 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
@@ -75,11 +75,11 @@
static final int Dot_linestyle = 13;
static final int DashDot_linestyle = 14;
static final int Font_options = 15;
-
+
static final int Default_tool = Pencil_tool;
static final int Default_fill = None_fill;
static final int Default_linestyle = Solid_linestyle;
-
+
public static final Tool[] tools = {
new Tool(Pencil_tool, "Pencil", "tool", SWT.RADIO),
new Tool(Airbrush_tool, "Airbrush", "tool", SWT.RADIO),
@@ -102,7 +102,7 @@
/**
* Creates an instance of a PaintExample embedded inside
* the supplied parent Composite.
- *
+ *
* @param parent the container of the example
*/
public PaintExample(Composite parent) {
@@ -134,7 +134,7 @@
}
instance.dispose();
}
-
+
/**
* Creates the toolbar.
* Note: Only called by standalone.
@@ -199,7 +199,7 @@
GridLayout gridLayout;
GridData gridData;
- /*** Create principal GUI layout elements ***/
+ /*** Create principal GUI layout elements ***/
Composite displayArea = new Composite(parent, SWT.NONE);
gridLayout = new GridLayout();
gridLayout.numColumns = 1;
@@ -211,14 +211,14 @@
// instantiate all of the non-GUI application elements to satisfy referential
// dependencies. It is possible to reorder the initialization to some extent, but
// this can be very tedious.
-
+
// paint canvas
final Canvas paintCanvas = new Canvas(displayArea, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL |
SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
paintCanvas.setLayoutData(gridData);
paintCanvas.setBackground(paintColorWhite);
-
+
// color selector frame
final Composite colorFrame = new Composite(displayArea, SWT.NONE);
gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
@@ -234,7 +234,7 @@
gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
statusText.setLayoutData(gridData);
- /*** Create the remaining application elements inside the principal GUI layout elements ***/
+ /*** Create the remaining application elements inside the principal GUI layout elements ***/
// paintSurface
paintSurface = new PaintSurface(paintCanvas, statusText, paintColorWhite);
@@ -248,7 +248,7 @@
tools[Ellipse_tool].data = new EllipseTool(toolSettings, paintSurface);
tools[Text_tool].data = new TextTool(toolSettings, paintSurface);
- // colorFrame
+ // colorFrame
gridLayout = new GridLayout();
gridLayout.numColumns = 3;
gridLayout.marginHeight = 0;
@@ -277,8 +277,8 @@
@Override
public void handleEvent(Event e) {
Rectangle bounds = paletteCanvas.getClientArea();
- Color color = getColorAt(bounds, e.x, e.y);
-
+ Color color = getColorAt(bounds, e.x, e.y);
+
if (e.button == 1) setForegroundColor(color);
else setBackgroundColor(color);
}
@@ -306,7 +306,7 @@
paletteCanvas.addListener(SWT.Resize, refreshListener);
paletteCanvas.addListener(SWT.Paint, refreshListener);
//paletteCanvas.redraw();
-
+
// toolSettingsFrame
gridLayout = new GridLayout();
gridLayout.numColumns = 4;
@@ -346,13 +346,13 @@
}
});
}
-
+
/**
* Disposes of all resources associated with a particular
* instance of the PaintExample.
- */
+ */
public void dispose() {
- if (paintSurface != null) paintSurface.dispose();
+ if (paintSurface != null) paintSurface.dispose();
if (paintColors != null) {
for (int i = 0; i < paintColors.length; ++i) {
final Color color = paintColors[i];
@@ -376,16 +376,16 @@
tool.image = null;
}
}
-
+
/**
* Returns the Display.
- *
+ *
* @return the display we're using
*/
public Display getDisplay() {
return mainComposite.getDisplay();
}
-
+
/**
* Gets a string from the resource bundle.
* We don't want to crash because of a missing String.
@@ -398,7 +398,7 @@
return key;
} catch (NullPointerException e) {
return "!" + key + "!";
- }
+ }
}
/**
@@ -421,10 +421,10 @@
*/
private void init() {
Display display = mainComposite.getDisplay();
-
+
paintColorWhite = new Color(display, 255, 255, 255);
paintColorBlack = new Color(display, 0, 0, 0);
-
+
paintDefaultFont = display.getSystemFont();
paintColors = new Color[numPaletteCols * numPaletteRows];
@@ -516,10 +516,10 @@
public void setFocus() {
mainComposite.setFocus();
}
-
+
/**
* Sets the tool foreground color.
- *
+ *
* @param color the new color to use
*/
public void setForegroundColor(Color color) {
@@ -531,7 +531,7 @@
/**
* Set the tool background color.
- *
+ *
* @param color the new color to use
*/
public void setBackgroundColor(Color color) {
@@ -549,14 +549,14 @@
paintSurface.setPaintSession(paintTool);
updateToolSettings();
}
-
+
/**
* Selects a filltype given its ID.
*/
public void setFillType(int id) {
Integer fillType = (Integer) tools[id].data;
toolSettings.commonFillType = fillType.intValue();
- updateToolSettings();
+ updateToolSettings();
}
/**
@@ -565,7 +565,7 @@
public void setLineStyle(int id) {
Integer lineType = (Integer) tools[id].data;
toolSettings.commonLineStyle = lineType.intValue();
- updateToolSettings();
+ updateToolSettings();
}
/**
@@ -587,7 +587,7 @@
private void updateToolSettings() {
final PaintTool activePaintTool = paintSurface.getPaintTool();
if (activePaintTool == null) return;
-
+
activePaintTool.endSession();
activePaintTool.set(toolSettings);
activePaintTool.beginSession();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
index 2fa86f5..c562166 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSession.java
@@ -17,41 +17,41 @@
* Manages an interactive paint session.
* Note that the coordinates received via the listener interfaces are virtualized to zero-origin
* relative to the painting surface.
- */
+ */
public interface PaintSession extends MouseListener, MouseMoveListener {
/**
* Returns the paint surface associated with this paint session
- *
+ *
* @return the associated PaintSurface
*/
public PaintSurface getPaintSurface();
/**
* Activates the session.
- *
+ *
* Note: When overriding this method, call super.beginSession() at method start.
*/
public abstract void beginSession();
-
+
/**
* Deactivates the session.
*
* Note: When overriding this method, call super.endSession() at method exit.
*/
public abstract void endSession();
-
+
/**
* Resets the session.
* Aborts any operation in progress.
- *
+ *
* Note: When overriding this method, call super.resetSession() at method exit.
*/
public abstract void resetSession();
-
-
+
+
/**
* Returns the name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
public String getDisplayName();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintTool.java
index ad5614e..063f981 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintTool.java
@@ -13,7 +13,7 @@
public interface PaintTool extends PaintSession {
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
public void set(ToolSettings toolSettings);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
index 6a8a6b8..ad39e13 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
@@ -18,10 +18,10 @@
*/
public class PencilTool extends ContinuousPaintSession implements PaintTool {
private ToolSettings settings;
-
+
/**
* Constructs a pencil tool.
- *
+ *
* @param toolSettings the new tool settings
* @param getPaintSurface() the PaintSurface we will render on.
*/
@@ -29,10 +29,10 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
@@ -42,7 +42,7 @@
/**
* Returns the name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PointFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PointFigure.java
index a7e60e3..fa0b9f3 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PointFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PointFigure.java
@@ -21,7 +21,7 @@
private int x, y;
/**
* Constructs a Point
- *
+ *
* @param color the color for this object
* @param x the virtual X coordinate of the first end-point
* @param y the virtual Y coordinate of the first end-point
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
index 6c3a8b3..8dccbd7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
@@ -21,7 +21,7 @@
/**
* Constructs a PolyLineTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -29,10 +29,10 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
@@ -42,7 +42,7 @@
/**
* Returns the name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleFigure.java
index af190ba..85adec5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleFigure.java
@@ -23,7 +23,7 @@
/**
* Constructs a Rectangle
* These objects are defined by any two diametrically opposing corners.
- *
+ *
* @param color the color for this object
* @param lineStyle the line style for this object
* @param x1 the virtual X coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
index b457d4f..cdbc28b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
@@ -21,7 +21,7 @@
/**
* Constructs a RectangleTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -29,20 +29,20 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
-
+
/**
* Returns name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
index 686ca65..7d5a018 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleFigure.java
@@ -23,7 +23,7 @@
/**
* Constructs a Rectangle
* These objects are defined by any two diametrically opposing corners.
- *
+ *
* @param color the color for this object
* @param lineStyle the line style for this object
* @param x1 the virtual X coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
index 0322ed9..521052b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
@@ -21,7 +21,7 @@
/**
* Constructs a RoundedRectangleTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -29,20 +29,20 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
-
+
/**
* Returns name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
index 9e76f43..8c3484b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
@@ -39,7 +39,7 @@
/**
* Constructs a PaintSession.
- *
+ *
* @param paintSurface the drawing surface to use
*/
protected SegmentedPaintSession(PaintSurface paintSurface) {
@@ -57,7 +57,7 @@
currentFigure = null;
controlPoints.clear();
}
-
+
/**
* Deactivates the tool.
*/
@@ -66,7 +66,7 @@
getPaintSurface().clearRubberbandSelection();
if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
}
-
+
/**
* Resets the tool.
* Aborts any operation in progress.
@@ -75,7 +75,7 @@
public void resetSession() {
getPaintSurface().clearRubberbandSelection();
if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
-
+
getPaintSurface().setStatusMessage(PaintExample.getResourceString(
"session.SegmentedInteractivePaint.message.anchorMode"));
previousFigure = null;
@@ -85,7 +85,7 @@
/**
* Handles a mouseDown event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -105,7 +105,7 @@
/**
* Handles a mouseDoubleClick event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -122,7 +122,7 @@
/**
* Handles a mouseUp event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -132,10 +132,10 @@
return;
}
}
-
+
/**
* Handles a mouseMove event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -152,11 +152,11 @@
points[controlPoints.size()] = ps.getCurrentPosition();
currentFigure = createFigure(points, points.length, false);
ps.addRubberbandSelection(currentFigure);
- }
+ }
/**
* Template Method: Creates a Figure for drawing rubberband entities and the final product
- *
+ *
* @param points the array of control points
* @param numPoints the number of valid points in the array (n >= 2)
* @param closed true if the user double-clicked on the final control point
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
index addaec6..a4b6685 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidEllipseFigure.java
@@ -23,7 +23,7 @@
* Constructs a SolidEllipse
* These objects are defined by any two diametrically opposing corners of a box
* bounding the ellipse.
- *
+ *
* @param color the color for this object
* @param x1 the virtual X coordinate of the first corner
* @param y1 the virtual Y coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
index b801f60..51d81d4 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidPolygonFigure.java
@@ -22,7 +22,7 @@
/**
* Constructs a SolidPolygon
* These objects are defined by a sequence of vertices.
- *
+ *
* @param color the color for this object
* @param vertices the array of vertices making up the polygon
* @param numPoint the number of valid points in the array (n >= 3)
@@ -55,7 +55,7 @@
if (points[i] > xmax) xmax = points[i];
if (points[i+1] < ymin) ymin = points[i+1];
if (points[i+1] > ymax) ymax = points[i+1];
- }
+ }
region.add(fdc.toClientRectangle(xmin, ymin, xmax, ymax));
}
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
index b6ef817..bb399fc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRectangleFigure.java
@@ -22,7 +22,7 @@
/**
* Constructs a SolidRectangle
* These objects are defined by any two diametrically opposing corners.
- *
+ *
* @param color the color for this object
* @param x1 the virtual X coordinate of the first corner
* @param y1 the virtual Y coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
index d633697..f393301 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SolidRoundedRectangleFigure.java
@@ -22,7 +22,7 @@
/**
* Constructs a SolidRectangle
* These objects are defined by any two diametrically opposing corners.
- *
+ *
* @param color the color for this object
* @param x1 the virtual X coordinate of the first corner
* @param y1 the virtual Y coordinate of the first corner
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextFigure.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextFigure.java
index 2fd9bd1..ae6a299 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextFigure.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextFigure.java
@@ -23,7 +23,7 @@
private int x, y;
/**
* Constructs a TextFigure
- *
+ *
* @param color the color for this object
* @param font the font for this object
* @param text the text to draw, tab and new-line expansion is performed
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
index feb3318..2bf75e2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
@@ -33,7 +33,7 @@
/**
* Constructs a PaintTool.
- *
+ *
* @param toolSettings the new tool settings
* @param paintSurface the PaintSurface we will render on.
*/
@@ -41,27 +41,27 @@
super(paintSurface);
set(toolSettings);
}
-
+
/**
* Sets the tool's settings.
- *
+ *
* @param toolSettings the new tool settings
*/
@Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
-
+
/**
* Returns name associated with this tool.
- *
+ *
* @return the localized name of this tool
*/
@Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Text.label");
}
-
+
/**
* Activates the tool.
*/
@@ -70,7 +70,7 @@
getPaintSurface().setStatusMessage(PaintExample.getResourceString(
"session.Text.message"));
}
-
+
/**
* Deactivates the tool.
*/
@@ -78,7 +78,7 @@
public void endSession() {
getPaintSurface().clearRubberbandSelection();
}
-
+
/**
* Aborts the current operation.
*/
@@ -86,10 +86,10 @@
public void resetSession() {
getPaintSurface().clearRubberbandSelection();
}
-
+
/**
* Handles a mouseDown event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -141,12 +141,12 @@
while (! shell.isDisposed() && ! dialog.isDisposed()) {
if (! display.readAndDispatch()) display.sleep();
}
- }
+ }
}
/**
* Handles a mouseDoubleClick event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
@@ -155,16 +155,16 @@
/**
* Handles a mouseUp event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
public void mouseUp(MouseEvent event) {
}
-
+
/**
* Handles a mouseMove event.
- *
+ *
* @param event the mouse event detail information
*/
@Override
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Tool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Tool.java
index 5b51ce2..8318782 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Tool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/Tool.java
@@ -20,7 +20,7 @@
public Runnable action;
public Image image = null;
public Object data;
-
+
public Tool(int id, String name, String group, int type) {
super();
this.id = id;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ToolSettings.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ToolSettings.java
index b69bedc..ee998e7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ToolSettings.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ToolSettings.java
@@ -44,17 +44,17 @@
* commonLineStyle: current line type
*/
public int commonLineStyle = SWT.LINE_SOLID;
-
+
/**
* airbrushRadius: coverage radius in pixels
*/
public int airbrushRadius = 10;
-
+
/**
* airbrushIntensity: average surface area coverage in region defined by radius per "jot"
*/
public int airbrushIntensity = 30;
-
+
/**
* roundedRectangleCornerDiameter: the diameter of curvature of corners in a rounded rectangle
*/