org.eclipse.ui.services.ISourceProviderService Java Examples

The following examples show how to use org.eclipse.ui.services.ISourceProviderService. 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: SessionManagerImpl.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void setSession ( final LoginSession session )
{
    checkRealm ();

    if ( this.session != null )
    {
        this.session.dispose ();
    }

    this.session = session;

    if ( this.session != null )
    {
        this.session.register ();
    }

    for ( final IWorkbenchWindow window : PlatformUI.getWorkbench ().getWorkbenchWindows () )
    {
        final ISourceProviderService service = (ISourceProviderService)window.getService ( ISourceProviderService.class );
        final LoginSessionProvider sessionSourceProvider = (LoginSessionProvider)service.getSourceProvider ( LoginSessionProvider.SESSION_STATE );
        sessionSourceProvider.setLoginSession ( session );
    }

    super.setSession ( session );
}
 
Example #2
Source File: SwtGui.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void updateExperimentState(final IScope scope, final String forcedState) {
	// DEBUG.OUT("STATE: " + forcedState);
	final ISourceProviderService service = WorkbenchHelper.getService(ISourceProviderService.class);
	final ISimulationStateProvider stateProvider = (ISimulationStateProvider) service
			.getSourceProvider("ummisco.gama.ui.experiment.SimulationRunningState");
	if (stateProvider != null) {
		WorkbenchHelper.run(() -> stateProvider.updateStateTo(forcedState));
	}
}
 
Example #3
Source File: WorkbenchUtils.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
public static ISourceProviderService getSourceProviderService() {
    return (ISourceProviderService) getService(ISourceProviderService.class);
}
 
Example #4
Source File: WorkbenchUtils.java    From xds-ide with Eclipse Public License 1.0 3 votes vote down vote up
/**
   * Retrieves a source provider providing the given source. This is used by
   * clients who only need specific sources.
   * 
   * @param sourceName  The name of the source; must not be <code>null</code>.
   * 
   * @return A source provider which provides the request source, or
   *         <code>null</code> if no such source exists.
   */    
  public static ISourceProvider getSourceProvider(String sourceName) {
      ISourceProviderService sourceProviderService = getSourceProviderService();
      if (sourceProviderService == null) {
      	return null;
      }
return sourceProviderService.getSourceProvider(sourceName);
  }