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


Java IWorkbenchWindow.getService方法代码示例

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


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

示例1: setSession

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:SessionManagerImpl.java

示例2: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
  final ISourceProviderService service =
      activeWorkbenchWindow.getService(ISourceProviderService.class);
  final AnalysisSourceProvider sourceProvider =
      (AnalysisSourceProvider) service.getSourceProvider(AnalysisSourceProvider.ANALYSIS_STATE);
  sourceProvider.setPassive();

  final Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
      AlloyValidator.isCanceled = true;
      AlloyOtherSolutionReasoning.getInstance().finish();
      AlloyOtherSolutionDiscovering.getInstance().finish();
      AlloyOtherSolutionReasoningForAtom.getInstance().finish();
      Visualization.showViz();
    }
  });
  thread.start();
  return true;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:23,代码来源:VizStopOtherSolutionHandler.java

示例3: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
  final ISourceProviderService service =
      activeWorkbenchWindow.getService(ISourceProviderService.class);
  final AnalysisSourceProvider sourceProvider =
      (AnalysisSourceProvider) service.getSourceProvider(AnalysisSourceProvider.ANALYSIS_STATE);

  final Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
      if (sourceProvider.getEvaluationState() == EvaluationState.OPEN) {
        Visualization.evaluatorOpen = false;
        sourceProvider.setEvaluationState(EvaluationState.CLOSE);
      } else if (sourceProvider.getEvaluationState() == EvaluationState.CLOSE) {
        Visualization.evaluatorOpen = true;
        sourceProvider.setEvaluationState(EvaluationState.OPEN);
      }
      Visualization.showViz();
    }
  });
  thread.start();
  return true;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:25,代码来源:OpenCloseEvaluatorHandler.java

示例4: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
  final ISourceProviderService service =
      activeWorkbenchWindow.getService(ISourceProviderService.class);
  final AnalysisSourceProvider sourceProvider =
      (AnalysisSourceProvider) service.getSourceProvider(AnalysisSourceProvider.ANALYSIS_STATE);
  sourceProvider.setActive(ReasoningType.DISCOVER_RELATION);

  final Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
      final AlloyReasoning alloyReasoning = new AlloyReasoning();
      final boolean reasoning = alloyReasoning.reasoning();
      if (!reasoning) {
        sourceProvider.setPassive();
      }

      Visualization.showViz();
    }
  });
  thread.start();
  return true;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:25,代码来源:VizDiscoverRelationsHandler.java

示例5: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
  final ISourceProviderService service =
      activeWorkbenchWindow.getService(ISourceProviderService.class);
  final AnalysisSourceProvider sourceProvider =
      (AnalysisSourceProvider) service.getSourceProvider(AnalysisSourceProvider.ANALYSIS_STATE);
  sourceProvider.setActive(ReasoningType.DISCOVER_ATOM);

  final Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
      final AlloyDiscovering alloyDiscovering = new AlloyDiscovering();
      final boolean discovering =
          alloyDiscovering.discovering();
      if (!discovering) {
        Visualization.sourceProvider.setPassive();
      }
      Visualization.showViz();
    }
  });
  thread.start();
  return true;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:25,代码来源:VizDiscoverAtomsHandler.java

示例6: execute

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  this.decoratorManager = Activator.getDefault().getWorkbench().getDecoratorManager();

  if (!this.isHidden) {
    this.isHidden = true;
    this.setStore(false);
    this.setDecorator(false);
  } else {
    this.isHidden = false;
    this.setStore(true);
    this.setDecorator(true);
  }
  this.store.needsSaving();

  final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  final ICommandService commandService = window.getService(ICommandService.class);
  if (commandService != null) {
    commandService.refreshElements(COMMAND_ID, null);
  }
  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:23,代码来源:MarkerVisibilityHandler.java

示例7: reviewDisabledCategoriesFromAppModel

import org.eclipse.ui.IWorkbenchWindow; //导入方法依赖的package包/类
/**
 * The 'Show View' dialog behavior slightly changed with E4. Even if the views are properly removed via activities
 * (by the unique view IDs) the content provider creates the root category for the unavailable views as well since
 * it is using the {@link MApplication}.
 */
private void reviewDisabledCategoriesFromAppModel() {
	final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
	final MApplication service = workbenchWindow.getService(MApplication.class);
	for (Iterator<MPartDescriptor> itr = service.getDescriptors().iterator(); itr.hasNext(); /**/) {
		final MPartDescriptor descriptor = itr.next();
		if (isView(descriptor) && isDisabledView(descriptor)) {
			itr.remove();
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:N4JSApplicationWorkbenchWindowAdvisor.java


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