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


Java AsyncResult.done方法代码示例

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


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

示例1: findDisposable

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
private static AsyncResult<Disposable> findDisposable(Disposable defaultValue, final Key<? extends Disposable> key) {
  if (defaultValue == null) {
    if (ApplicationManager.getApplication() != null) {
      final AsyncResult<Disposable> result = new AsyncResult<>();
      DataManager.getInstance().getDataContextFromFocus().doWhenDone(context -> {
        Disposable disposable = context.getData(key);
        if (disposable == null) {
          disposable = Disposer.get("ui");
        }
        result.setDone(disposable);
      });
      return result;
    }
    else {
      return null;
    }
  }
  else {
    return AsyncResult.done(defaultValue);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:LazyUiDisposable.java

示例2: calculateEvaluationExpression

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
/**
 * Asynchronously calculates expression which evaluates to the current value
 */
@Nonnull
public AsyncResult<XExpression> calculateEvaluationExpression() {
  String expression = getEvaluationExpression();
  XExpression res =
          expression != null ? XDebuggerUtil.getInstance().createExpression(expression, null, null, EvaluationMode.EXPRESSION) : null;
  return AsyncResult.done(res);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:XValue.java

示例3: startRunProfile

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
protected static void startRunProfile(ExecutionEnvironment environment,
                                      RunProfileState state,
                                      ProgramRunner.Callback callback,
                                      @Nullable RunProfileStarter starter) {

  ThrowableComputable<AsyncResult<RunContentDescriptor>, ExecutionException> func = () -> {
    AsyncResult<RunContentDescriptor> promise = starter == null ? AsyncResult.done(null) : starter.executeAsync(state, environment);
    return promise.doWhenDone(it -> BaseProgramRunner.postProcess(environment, it, callback));
  };

  ExecutionManager.getInstance(environment.getProject()).startRunProfile(runProfileStarter(func), state, environment);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:AsyncProgramRunner.java

示例4: addExternalLibraryDependency

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Override
public AsyncResult<Void> addExternalLibraryDependency(@NotNull final Collection<Module> modules, @NotNull final ExternalLibraryDescriptor descriptor, @NotNull final DependencyScope scope)
{
	List<String> defaultRoots = descriptor.getLibraryClassesRoots();
	Module firstModule = ContainerUtil.getFirstItem(modules);
	LOG.assertTrue(firstModule != null);
	LocateLibraryDialog dialog = new LocateLibraryDialog(firstModule, defaultRoots, descriptor.getPresentableName());
	List<String> classesRoots = dialog.showAndGetResult();
	if(!classesRoots.isEmpty())
	{
		String libraryName = classesRoots.size() > 1 ? descriptor.getPresentableName() : null;
		final List<String> urls = OrderEntryFix.refreshAndConvertToUrls(classesRoots);
		if(modules.size() == 1)
		{
			ModuleRootModificationUtil.addModuleLibrary(firstModule, libraryName, urls, Collections.emptyList(), scope);
		}
		else
		{
			new WriteAction()
			{
				protected void run(@NotNull Result result)
				{
					Library library = LibraryUtil.createLibrary(LibraryTablesRegistrar.getInstance().getLibraryTable(myProject), descriptor.getPresentableName());
					Library.ModifiableModel model = library.getModifiableModel();
					for(String url : urls)
					{
						model.addRoot(url, OrderRootType.CLASSES);
					}
					model.commit();
					for(Module module : modules)
					{
						ModuleRootModificationUtil.addDependency(module, library, scope, false);
					}
				}
			}.execute();
		}
	}
	return AsyncResult.done(null);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:40,代码来源:IdeaProjectModelModifier.java

示例5: changeLanguageLevel

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Override
@RequiredReadAction
public AsyncResult<Void> changeLanguageLevel(@NotNull Module module, @NotNull LanguageLevel level)
{
	if(JavaSdkUtil.isLanguageLevelAcceptable(myProject, module, level))
	{
		final ModifiableRootModel rootModel = ModuleRootManager.getInstance(module).getModifiableModel();
		rootModel.getExtension(JavaMutableModuleExtension.class).getInheritableLanguageLevel().set(null, level);
		rootModel.commit();
	}
	return AsyncResult.done(null);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:IdeaProjectModelModifier.java

示例6: createNewRenderer

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@NotNull
@Override
protected AsyncResult<ArrayRenderer> createNewRenderer(XValueNodeImpl node, ArrayRenderer original, @NotNull DebuggerContextImpl debuggerContext, String title)
{
	ArrayRenderer clonedRenderer = original.clone();
	clonedRenderer.setForced(true);
	if(ShowSettingsUtil.getInstance().editConfigurable(debuggerContext.getProject(), new NamedArrayConfigurable(title, clonedRenderer)))
	{
		return AsyncResult.done(clonedRenderer);
	}
	return AsyncResult.rejected();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:13,代码来源:ArrayAction.java

示例7: revalidateElement

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
public AsyncResult<Object> revalidateElement(Object element) {
  return AsyncResult.done(element);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:AbstractTreeStructure.java

示例8: stopAsync

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Nonnull
public AsyncResult<Void> stopAsync() {
  stop();
  return AsyncResult.done(null);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:XDebugProcess.java

示例9: calculateEvaluationExpression

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Override
@Nonnull
public AsyncResult<XExpression> calculateEvaluationExpression() {
  return AsyncResult.done(myExpression);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:WatchNodeImpl.java

示例10: addModuleDependency

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Override
public AsyncResult<Void> addModuleDependency(@NotNull Module from, @NotNull Module to, @NotNull DependencyScope scope)
{
	ModuleRootModificationUtil.addDependency(from, to, scope, false);
	return AsyncResult.done(null);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:IdeaProjectModelModifier.java

示例11: addLibraryDependency

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
@Override
public AsyncResult<Void> addLibraryDependency(@NotNull Module from, @NotNull Library library, @NotNull DependencyScope scope)
{
	OrderEntryUtil.addLibraryToRoots(from, library);
	return AsyncResult.done(null);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:IdeaProjectModelModifier.java

示例12: executeAsync

import com.intellij.openapi.util.AsyncResult; //导入方法依赖的package包/类
/**
 * You should NOT throw exceptions in this method.
 * Instead return {@link AsyncResult#done(Object)} (Throwable)} or call {@link AsyncResult#rejectWithThrowable(Throwable)} 
 */
public AsyncResult<RunContentDescriptor> executeAsync(@Nonnull RunProfileState state, @Nonnull ExecutionEnvironment environment) throws ExecutionException {
  return AsyncResult.done(execute(state, environment));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:RunProfileStarter.java


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