本文整理汇总了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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
}