当前位置: 首页>>代码示例>>Java>>正文


Java Display.isDisposed方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Display.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Display.isDisposed方法的具体用法?Java Display.isDisposed怎么用?Java Display.isDisposed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Display的用法示例。


在下文中一共展示了Display.isDisposed方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runEventLoop

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void runEventLoop(Shell loopShell) {
	Display display;
	if (getShell() == null) {
		display = Display.getCurrent();
	} else {
		display = loopShell.getDisplay();
	}

	while (loopShell != null && !loopShell.isDisposed()) {
		try {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		} catch (Throwable e) {
			EclipseUtil.logError("UI problems on dispatch",e);
		}
	}
	if (!display.isDisposed()) {
		display.update();
	}
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:22,代码来源:AbstractQuickDialog.java

示例2: triggerErrorLabel

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void triggerErrorLabel ( final String string )
{
    final Display d = this.errorLabel.getDisplay ();
    if ( !d.isDisposed () )
    {
        d.asyncExec ( new Runnable () {

            @Override
            public void run ()
            {
                if ( !GeneratorView.this.errorLabel.isDisposed () )
                {
                    GeneratorView.this.errorLabel.setText ( string );
                }
            }
        } );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:GeneratorView.java

示例3: notifyError

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
/**
 * Notify error using message box (thread safe).
 * @param message The message to display
 * @param error The error that occurred
 */
public void notifyError ( final String message, final Throwable error )
{
    final Display display = getWorkbench ().getDisplay ();

    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            @Override
            public void run ()
            {
                final Shell shell = getWorkbench ().getActiveWorkbenchWindow ().getShell ();
                logger.debug ( "Shell disposed: {}", shell.isDisposed () );
                if ( !shell.isDisposed () )
                {
                    final IStatus status = new OperationStatus ( IStatus.ERROR, PLUGIN_ID, 0, message + ":" + error.getMessage (), error );
                    ErrorDialog.openError ( shell, null, message, status );
                }
            }
        } );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:28,代码来源:Activator.java

示例4: showError

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void showError ( final IStatus status )
{
    if ( !status.matches ( IStatus.ERROR ) )
    {
        return;
    }

    final Display display = PlatformUI.getWorkbench ().getDisplay ();
    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            @Override
            public void run ()
            {
                if ( !display.isDisposed () )
                {
                    ErrorDialog.openError ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getShell (), "Connection error", "Connection failed", status, IStatus.ERROR );
                }
            }
        } );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:ConnectionManager.java

示例5: setStyle

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void setStyle ( final Style style )
{
    final Display display = Display.getDefault ();
    if ( display.isDisposed () )
    {
        return;
    }

    Display.getDefault ().asyncExec ( new Runnable () {

        @Override
        public void run ()
        {
            if ( display.isDisposed () )
            {
                return;
            }
            performSetStyle ( style );
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:StyleBlinker.java

示例6: triggerDataUpdate

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void triggerDataUpdate ()
{
    final Display display = getDisplay ();
    if ( display.isDisposed () )
    {
        return;
    }

    getDisplay ().asyncExec ( new Runnable () {
        @Override
        public void run ()
        {
            if ( display.isDisposed () )
            {
                return;
            }

            updateState ();
        }
    } );

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:BlockControlImage.java

示例7: handleSetResult

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
protected void handleSetResult ( final FactoryInformation factory, final String connectionUri )
{
    final Display display = getSite ().getShell ().getDisplay ();
    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            @Override
            public void run ()
            {
                if ( !display.isDisposed () )
                {
                    setResult ( factory, connectionUri );
                }
            }
        } );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:FactoryEditor.java

示例8: asyncRefreshCommonViewer

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void asyncRefreshCommonViewer(final ProjectExplorer explorer, final boolean resetInput) {

		// do deferred initialization
		this.getWorkingSetManagers().stream()
				.filter(m -> (m instanceof IDeferredInitializer))
				.map(m -> (IDeferredInitializer) m)
				.filter(m -> m.isInitializationRequired())
				.forEach(m -> {
					m.lateInit();
				});

		final CommonViewer viewer = explorer.getCommonViewer();
		final Display d = getDisplay();
		if (!d.isDisposed()) {
			if (resetInput) {
				d.asyncExec(() -> {
					if (!viewer.getTree().isDisposed())
						viewer.setInput(viewer.getInput());
				});
			} else {
				d.asyncExec(() -> {
					if (!viewer.getTree().isDisposed())
						viewer.refresh(true);
				});
			}
		}
	}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:WorkingSetManagerBrokerImpl.java

示例9: fireChangeEvent

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
protected final void fireChangeEvent ( final Collection<?> changes )
{

    final LabelProviderChangedEvent event = new LabelProviderChangedEvent ( ViewerLabelProvider.this, changes.toArray () );
    final ILabelProviderListener[] listenerArray = ViewerLabelProvider.this.listeners.toArray ( new ILabelProviderListener[ViewerLabelProvider.this.listeners.size ()] );

    final Display display = getDisplay ();
    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            public void run ()
            {
                for ( final ILabelProviderListener listener : listenerArray )
                {
                    try
                    {
                        listener.labelProviderChanged ( event );
                    }
                    catch ( final Exception e )
                    {
                        Policy.getLog ().log ( new Status ( IStatus.ERROR, Policy.JFACE_DATABINDING, e.getLocalizedMessage (), e ) );
                    }
                }

            }
        } );

    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:ViewerLabelProvider.java

示例10: getInstance

import org.eclipse.swt.widgets.Display; //导入方法依赖的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

示例11: checkDisplay

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
public static boolean checkDisplay(Observer<?> observer, Display display) {
	if (null == display) {
		observer.onError(new NullPointerException("The given widget was null"));
		return false;
	} else if (display.isDisposed()) {
		observer.onError(new IllegalStateException("The given widget is diposed"));
		return false;
	} else if (!(Thread.currentThread().equals(display.getThread()))) {
		observer.onError(new IllegalStateException(
				"Expected to be called on the main thread but was " + Thread.currentThread().getName()));
		return false;
	}
	return true;
}
 
开发者ID:SimonScholz,项目名称:RxSWT,代码行数:15,代码来源:Preconditions.java

示例12: openChat

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public void
openChat(
	final ChatInstance chat )
{
	final Display display = Display.getDefault();

	if ( display.isDisposed()){

		return;
	}

	display.asyncExec(
		new Runnable()
		{
			@Override
			public void
			run()
			{
				if ( display.isDisposed()){

					return;
				}

				BuddyPluginViewBetaChat.createChatWindow( BuddyPluginView.this, plugin, chat );
			}
		});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:29,代码来源:BuddyPluginView.java

示例13: update

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
private void update(CopyOnWriteList<UIUpdatable> updateables, boolean is_visible ) {
	long start = 0;
	Map<UIUpdatable, Long> mapTimeMap = DEBUG_TIMER ? new HashMap<UIUpdatable, Long>() : null;

	Display display = Utils.getDisplay();
	if (display == null || display.isDisposed()) {
		return;
	}

	for ( UIUpdatable updateable: updateables ){
		try {
			if (DEBUG_TIMER) {
				start = SystemTime.getCurrentTime();
			}
			if ( updateable instanceof UIUpdatableAlways ){
				((UIUpdatableAlways)updateable).updateUI(is_visible);
			}else{
				updateable.updateUI();
			}

			if (DEBUG_TIMER) {
				long diff = SystemTime.getCurrentTime() - start;
				if (diff > 0) {
					mapTimeMap.put(updateable, new Long(diff));
				}
			}
		} catch (Throwable t) {
			Logger.log(new LogEvent(LOGID,
					"Error while trying to update UI Element "
							+ updateable.getUpdateUIName(), t));
		}
	}
	if (DEBUG_TIMER) {
		makeDebugToolTip(mapTimeMap);
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:37,代码来源:UIUpdaterSWT.java

示例14: selectNetworks

import org.eclipse.swt.widgets.Display; //导入方法依赖的package包/类
@Override
public String[]
selectNetworks(
	final String	description,
	final String[]	tracker_networks )
{
	final Display	display = Utils.getDisplay();

	if ( display.isDisposed()){

		return( null );
	}

	final AESemaphore	sem = new AESemaphore("NetworkClassifier");

	final classifierDialog[]	dialog = new classifierDialog[1];

	try{
		Utils.execSWTThread(
			new AERunnable()
			{
				@Override
				public void
				runSupport()
				{
					dialog[0] = new classifierDialog( sem, display, description, tracker_networks );
				}
			});
	}catch( Throwable e ){

		Debug.printStackTrace( e );

		return( null );
	}

	sem.reserve();

	return( dialog[0].getSelection());
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:40,代码来源:SWTNetworkSelection.java


注:本文中的org.eclipse.swt.widgets.Display.isDisposed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。