當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。