當前位置: 首頁>>代碼示例>>Java>>正文


Java SWT.error方法代碼示例

本文整理匯總了Java中org.eclipse.swt.SWT.error方法的典型用法代碼示例。如果您正苦於以下問題:Java SWT.error方法的具體用法?Java SWT.error怎麽用?Java SWT.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.error方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkWidget

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
protected void checkWidget ()
{
    try
    {
        this.realm.checkRealm ();
    }
    catch ( final IllegalAccessException e )
    {
        SWT.error ( SWT.ERROR_THREAD_INVALID_ACCESS, e );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:12,代碼來源:AbstractRenderer.java

示例2: checkDisplay

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
protected void checkDisplay ()
{
    if ( Display.getCurrent () != this.display )
    {
        SWT.error ( SWT.ERROR_THREAD_INVALID_ACCESS );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:8,代碼來源:DisplayBlinkServiceImpl.java

示例3: checkDisplay

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
private void checkDisplay ()
{
    if ( Display.getCurrent () != this.display )
    {
        SWT.error ( SWT.ERROR_THREAD_INVALID_ACCESS );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:8,代碼來源:KeyInstanceManager.java

示例4: getInstance

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
public static KeyInstanceManager getInstance ( final Display display )
{
    if ( display == null )
    {
        SWT.error ( SWT.ERROR_NULL_ARGUMENT );
    }

    if ( Display.getCurrent () != display )
    {
        SWT.error ( SWT.ERROR_THREAD_INVALID_ACCESS );
    }

    if ( display.isDisposed () )
    {
        SWT.error ( SWT.ERROR_DEVICE_DISPOSED );
    }

    KeyInstanceManager mgr = instanceMap.get ( display );
    if ( mgr != null )
    {
        return mgr;
    }

    mgr = new KeyInstanceManager ( display );
    instanceMap.put ( display, mgr );

    display.disposeExec ( new Runnable () {

        @Override
        public void run ()
        {
            disposeDisplay ( display );
        }
    } );

    return mgr;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:38,代碼來源:KeyInstanceManager.java

示例5: addDocumentCompletedListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Adds a DocumentCompletedListener to the WebViewer. This listener will be fired when the document is completly loaded
 * 
 * @param  listener the DocumentCompletedListener to be added
 */
public synchronized void addDocumentCompletedListener(DocumentCompletedListener listener) {
	composite.checkWidget();
	if (listener == null)
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	documentCompletedListeners.add(listener);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:12,代碼來源:XulWebViewerImpl.java

示例6: addHttpProxyEventListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Adds a HttpProxyEventListener to the WebViewer. This listener will be fired when a http request is done
 * 
 * @param  listener the HttpProxyEventListener to be added
 */
public synchronized void addHttpProxyEventListener(HttpProxyEventListener listener) {
	composite.checkWidget();
	if (listener == null)
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	httpProxyEventListeners.add(listener);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:12,代碼來源:XulWebViewerImpl.java

示例7: addSelectionChangedListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Adds a SelectionChangedListener to the WebViewer. This listener will be fired when the users selects an element
 * in the web page
 * 
 * @param  listener the SelectionChangedListener to be added
 */
public void addSelectionChangedListener(SelectionChangedListener listener) {
	composite.checkWidget();
	if (listener == null)
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	selectionChangedListeners.add(listener);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:13,代碼來源:XulWebViewerImpl.java

示例8: CocoaUIEnhancer

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
private CocoaUIEnhancer()
		throws Throwable {

	// Instead of creating a new delegate class in objective-c,
	// just use the current SWTApplicationDelegate. An instance of this
	// is a field of the Cocoa Display object and is already the target
	// for the menuItems. So just get this class and add the new methods
	// to it.
	Object delegateObjSWTApplication = invoke(osCls, "objc_lookUpClass",
			new Object[] {
				"SWTApplicationDelegate"
			});
	delegateIdSWTApplication = convertToLong(delegateObjSWTApplication);

	// This doesn't feel right, but it works
	Class<?> swtapplicationdelegateCls = classForName("org.eclipse.swt.internal.cocoa.SWTApplicationDelegate");
	delegate = swtapplicationdelegateCls.newInstance();
	Object delegateAlloc = invoke(delegate, "alloc");
	invoke(delegateAlloc, "init");
	Object delegateIdObj = nsidCls.getField("id").get(delegate);
	delegateJniRef = ((Number) invoke(osCls, "NewGlobalRef", new Class<?>[] {
		Object.class
	}, new Object[] {
		CocoaUIEnhancer.this
	})).longValue();
	if (delegateJniRef == 0)
		SWT.error(SWT.ERROR_NO_HANDLES);
	//OS.object_setInstanceVariable(delegate.id, SWT_OBJECT, delegateJniRef);
	invoke(osCls, "object_setInstanceVariable", new Object[] {
		delegateIdObj,
		SWT_OBJECT,
		wrapPointer(delegateJniRef)
	});
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:35,代碼來源:CocoaUIEnhancer.java

示例9: removeDocumentCompletedListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
public synchronized void removeDocumentCompletedListener(DocumentCompletedListener listener) {
	composite.checkWidget();
	if (listener == null)
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	documentCompletedListeners.remove(listener);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:7,代碼來源:XulWebViewerImpl.java

示例10: removeHttpProxyEventListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
public synchronized void removeHttpProxyEventListener(HttpProxyEventListener listener) {
	composite.checkWidget();
	if (listener == null)
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	httpProxyEventListeners.remove(listener);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:7,代碼來源:XulWebViewerImpl.java

示例11: addSelectionListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Adds the listener to the collection of listeners who will be notified when the control 
 * is selected by the user, by sending it one of the messages defined in the 
 * <code>SelectionListener</code> interface.
 * <p>
 * <code>widgetDefaultSelected</code> is not called.
 * </p>
 * 
 * @param listener the listener which should be notified when the control is selected by the user,
 * 
 * @exception IllegalArgumentException <ul>
 *     <li>ERROR_NULL_ARGUMENT - if the listener is null</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>
 * 
 * @see SelectionListener
 * @see #removeSelectionListener
 * @see SelectionEvent
 */
public void addSelectionListener(final SelectionListener listener) {
	checkWidget();
	if (listener == null) {
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	}
	this.selectionListeners.add(listener);
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:30,代碼來源:BreadcrumbItem.java

示例12: removeSelectionListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Removes the listener from the collection of listeners who will be notified when the 
 * control is selected by the user.
 * 
 * @param listener the listener which should no longer be notified
 * 
 * @exception IllegalArgumentException <ul>
 *     <li>ERROR_NULL_ARGUMENT - if the listener is null</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>
 * 
 * @see SelectionListener
 * @see #addSelectionListener
 */
public void removeSelectionListener(final SelectionListener listener) {
	checkWidget();
	if (listener == null) {
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	}
	this.selectionListeners.remove(listener);
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:25,代碼來源:BreadcrumbItem.java

示例13: setBounds

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Sets the receiver's size and location to the rectangular area specified by the argument. 
 * The <code>x</code> and <code>y</code> fields of the rectangle are relative to the receiver's 
 * parent (or its display if its parent is null).
 * <p>
 * Note: Attempting to set the width or height of the receiver to a negative number will cause 
 * that value to be set to zero instead.
 * </p>
 * 
 * @param rect the new bounds for 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>
 * </ul>
 */
public void setBounds(final Rectangle rectangle) {
	checkWidget();
	if (this.bounds == null) {
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	}
	this.bounds = new Rectangle(Math.max(0, rectangle.x), //
			Math.max(0, rectangle.y), //
			Math.max(0, rectangle.width), //
			Math.max(0, rectangle.height));
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:27,代碼來源:BreadcrumbItem.java

示例14: getItem

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</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>
 */
public BreadcrumbItem getItem(final int index) {
	checkWidget();
	if (index < 0 || index > this.items.size()) {
		SWT.error(SWT.ERROR_INVALID_ARGUMENT);
	}
	return this.items.get(index);
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:23,代碼來源:Breadcrumb.java


注:本文中的org.eclipse.swt.SWT.error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。