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


Java ImportOptimizer类代码示例

本文整理汇总了Java中com.intellij.lang.ImportOptimizer的典型用法代码示例。如果您正苦于以下问题:Java ImportOptimizer类的具体用法?Java ImportOptimizer怎么用?Java ImportOptimizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: applyFix

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
  final PsiElement psiElement = descriptor.getPsiElement();
  if (psiElement == null) return;
  final PsiFile file = psiElement.getContainingFile();
  if (file == null || !JavaFxFileTypeFactory.isFxml(file)) return;
  if (!FileModificationService.getInstance().prepareFileForWrite(file)) return;
  ImportOptimizer optimizer = new JavaFxImportsOptimizer();
  final Runnable runnable = optimizer.processFile(file);
  new WriteCommandAction.Simple(project, getFamilyName(), file) {
    @Override
    protected void run() throws Throwable {
      runnable.run();
    }
  }.execute();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:JavaFxUnusedImportsInspection.java

示例2: retrieveAndStoreNotificationInfo

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
private void retrieveAndStoreNotificationInfo(@NotNull Runnable runnable) {
  if (runnable instanceof ImportOptimizer.CollectingInfoRunnable) {
    String optimizerMessage = ((ImportOptimizer.CollectingInfoRunnable)runnable).getUserNotificationInfo();
    myOptimizerNotifications.add(optimizerMessage != null ? new NotificationInfo(optimizerMessage) : NOTHING_CHANGED_NOTIFICATION);
  }
  else if (runnable == EmptyRunnable.getInstance()) {
    myOptimizerNotifications.add(NOTHING_CHANGED_NOTIFICATION);
  }
  else {
    myOptimizerNotifications.add(SOMETHING_CHANGED_WITHOUT_MESSAGE_NOTIFICATION);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OptimizeImportsProcessor.java

示例3: optimizeImports

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
private void optimizeImports(final Project project, final PsiFile file) {
  ImportOptimizer optimizer = new PyImportOptimizer();
  final Runnable runnable = optimizer.processFile(file);
  new WriteCommandAction.Simple(project, getFamilyName(), file) {
    @Override
    protected void run() throws Throwable {
      runnable.run();
    }
  }.execute();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:OptimizeImportsQuickFix.java

示例4: optimizeImports

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
private void optimizeImports(final Project project, final SchemaFile file) {
  ImportOptimizer optimizer = new SchemaImportOptimizer();

  final Runnable runnable = optimizer.processFile(file);
  new WriteCommandAction.Simple(project, getFamilyName(), file) {
    @Override
    protected void run() throws Throwable {
      runnable.run();
    }
  }.execute();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:12,代码来源:OptimizeImportsQuickFix.java

示例5: invoke

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
public void invoke(@NotNull final Project project, PsiFile file) {
  ImportOptimizer optimizer = new HaxeImportOptimizer();
  final Runnable runnable = optimizer.processFile(file);
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    public void run() {
      CommandProcessor.getInstance().executeCommand(project, runnable, getFamilyName(), this);
    }
  });
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:10,代码来源:HaxeUnusedImportInspection.java

示例6: invoke

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
public void invoke(@NotNull final Project project, PsiFile file)
{
	ImportOptimizer optimizer = new HaxeImportOptimizer();
	final Runnable runnable = optimizer.processFile(file);
	ApplicationManager.getApplication().runWriteAction(new Runnable()
	{
		@Override
		public void run()
		{
			CommandProcessor.getInstance().executeCommand(project, runnable, getFamilyName(), this);
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:14,代码来源:HaxeUnusedImportInspection.java

示例7: applyFix

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor)
{
	final PsiElement psiElement = descriptor.getPsiElement();
	if(psiElement == null)
	{
		return;
	}
	final PsiFile file = psiElement.getContainingFile();
	if(file == null || !JavaFxFileTypeFactory.isFxml(file))
	{
		return;
	}
	if(!FileModificationService.getInstance().prepareFileForWrite(file))
	{
		return;
	}
	ImportOptimizer optimizer = new JavaFxImportsOptimizer();
	final Runnable runnable = optimizer.processFile(file);
	new WriteCommandAction.Simple(project, getFamilyName(), file)
	{
		@Override
		protected void run() throws Throwable
		{
			runnable.run();
		}
	}.execute();
}
 
开发者ID:consulo,项目名称:consulo-javafx,代码行数:29,代码来源:JavaFxUnusedImportsInspection.java

示例8: retrieveAndStoreNotificationInfo

import com.intellij.lang.ImportOptimizer; //导入依赖的package包/类
private void retrieveAndStoreNotificationInfo(@Nonnull Runnable runnable) {
  if (runnable instanceof ImportOptimizer.CollectingInfoRunnable) {
    String optimizerMessage = ((ImportOptimizer.CollectingInfoRunnable)runnable).getUserNotificationInfo();
    myOptimizerNotifications.add(optimizerMessage != null ? new NotificationInfo(optimizerMessage) : NOTHING_CHANGED_NOTIFICATION);
  }
  else if (runnable == EmptyRunnable.getInstance()) {
    myOptimizerNotifications.add(NOTHING_CHANGED_NOTIFICATION);
  }
  else {
    myOptimizerNotifications.add(SOMETHING_CHANGED_WITHOUT_MESSAGE_NOTIFICATION);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:OptimizeImportsProcessor.java


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