Java Code Examples for org.eclipse.swt.SWT#ERROR_NULL_ARGUMENT

The following examples show how to use org.eclipse.swt.SWT#ERROR_NULL_ARGUMENT . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 6 votes vote down vote up
void addItem(TableTreeItem item, int index) {
	if (item == null)
		throw new SWTError(SWT.ERROR_NULL_ARGUMENT);

	if (index < 0 || index > items.length)
		throw new SWTError(SWT.ERROR_INVALID_ARGUMENT);

	/* Now that item has a sub-node it must provide a cue that it can be expanded */

	if (items.length == 0 && index == 0) {
		if (tableItem != null) {
			Image image = expanded ? parent.getMinusImage()
					: parent.getPlusImage();
			tableItem.setImage(0, image);
		}
	}

	TableTreeItem[] newItems = new TableTreeItem[items.length + 1];
	System.arraycopy(items, 0, newItems, 0, index);
	newItems[index] = item;
	System.arraycopy(items, index, newItems, index + 1, items.length - index);
	items = newItems;
	if (expanded)
		item.setVisible(true);
}
 
Example 2
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 5 votes vote down vote up
public void setSelection(TableTreeItem[] items) {
	TableItem[] tableItems = new TableItem[items.length];
	for (int i = 0; i < items.length; i++) {
		if (items[i] == null)
			throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
		if (!items[i].getVisible())
			expandItem(items[i]);
		tableItems[i] = items[i].tableItem;
	}
	table.setSelection(tableItems);
}
 
Example 3
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 5 votes vote down vote up
public void showItem(TableTreeItem item) {
	if (item == null)
		throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
	if (!item.getVisible())
		expandItem(item);
	TableItem tableItem = item.tableItem;
	table.showItem(tableItem);
}
 
Example 4
Source Project: birt   File: CSpinner.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void addSelectionListener( SelectionListener listener )
{

	if ( listener == null )
		throw new SWTError( SWT.ERROR_NULL_ARGUMENT );
	addListener( SWT.Selection, new TypedListener( listener ) );
}
 
Example 5
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 4 votes vote down vote up
public void removeSelectionListener(SelectionListener listener) {
	if (listener == null)
		throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
	removeListener(SWT.Selection, listener);
	removeListener(SWT.DefaultSelection, listener);
}
 
Example 6
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 4 votes vote down vote up
public void removeTreeListener(TreeListener listener) {
	if (listener == null)
		throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
	removeListener(SWT.Expand, listener);
	removeListener(SWT.Collapse, listener);
}
 
Example 7
Source Project: atdl4j   File: SWTNullableSpinner.java    License: MIT License 4 votes vote down vote up
public void addSelectionListener(SelectionListener listener) {
	if (listener == null)
		throw new SWTError(SWT.ERROR_NULL_ARGUMENT);
	addListener(SWT.Selection, new TypedListener(listener));
}
 
Example 8
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 3 votes vote down vote up
public void addSelectionListener(SelectionListener listener) {

			if (listener == null)
				throw new SWTError(SWT.ERROR_NULL_ARGUMENT);

			TypedListener typedListener = new TypedListener(listener);

			addListener(SWT.Selection, typedListener);

			addListener(SWT.DefaultSelection, typedListener);

		}
 
Example 9
Source Project: SWET   File: ManageableTableTreeEx.java    License: MIT License 3 votes vote down vote up
public void addTreeListener(TreeListener listener) {

			if (listener == null)
				throw new SWTError(SWT.ERROR_NULL_ARGUMENT);

			TypedListener typedListener = new TypedListener(listener);

			addListener(SWT.Expand, typedListener);

			addListener(SWT.Collapse, typedListener);

		}