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 . 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 File: ManageableTableTreeEx.java    From SWET with 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 File: ManageableTableTreeEx.java    From SWET with 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 File: ManageableTableTreeEx.java    From SWET with 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 File: CSpinner.java    From birt with 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 File: ManageableTableTreeEx.java    From SWET with 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 File: ManageableTableTreeEx.java    From SWET with 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 File: SWTNullableSpinner.java    From atdl4j with 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 File: ManageableTableTreeEx.java    From SWET with 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 File: ManageableTableTreeEx.java    From SWET with 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);

		}