當前位置: 首頁>>代碼示例>>Java>>正文


Java DumbService.setAlternativeResolveEnabled方法代碼示例

本文整理匯總了Java中com.intellij.openapi.project.DumbService.setAlternativeResolveEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java DumbService.setAlternativeResolveEnabled方法的具體用法?Java DumbService.setAlternativeResolveEnabled怎麽用?Java DumbService.setAlternativeResolveEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.project.DumbService的用法示例。


在下文中一共展示了DumbService.setAlternativeResolveEnabled方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createJavaParameters

import com.intellij.openapi.project.DumbService; //導入方法依賴的package包/類
@Override
protected JavaParameters createJavaParameters() throws ExecutionException {
  final JavaParameters javaParameters = super.createJavaParameters();
  final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
  final DumbService dumbService = DumbService.getInstance(getConfiguration().getProject());
  try {
    dumbService.setAlternativeResolveEnabled(true);
    getClassFilter(data);//check if junit found
  }
  finally {
    dumbService.setAlternativeResolveEnabled(false);
  }
  createTempFiles(javaParameters);

  createServerSocket(javaParameters);
  return javaParameters;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:TestPackage.java

示例2: navigate

import com.intellij.openapi.project.DumbService; //導入方法依賴的package包/類
@Override
public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) {
  final List<PsiElement> list;

  DumbService dumbService = elt != null ? DumbService.getInstance(elt.getProject()) : null;
  if (dumbService != null) dumbService.setAlternativeResolveEnabled(true);
  try {
    list = getTargetElements();
  }
  finally {
    if (dumbService != null) dumbService.setAlternativeResolveEnabled(false);
  }
  
  if (list.isEmpty()) {
    if (myEmptyText != null) {
      if (event != null) {
        final JComponent label = HintUtil.createErrorLabel(myEmptyText);
        label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7));
        JBPopupFactory.getInstance().createBalloonBuilder(label)
          .setFadeoutTime(3000)
          .setFillColor(HintUtil.ERROR_COLOR)
          .createBalloon()
          .show(new RelativePoint(event), Balloon.Position.above);
      }
    }
    return;
  }
  if (list.size() == 1) {
    PsiNavigateUtil.navigate(list.iterator().next());
  }
  else {
    if (event != null) {
      final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle);
      popup.show(new RelativePoint(event));
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:38,代碼來源:NavigationGutterIconRenderer.java

示例3: processTypeVars

import com.intellij.openapi.project.DumbService; //導入方法依賴的package包/類
private String processTypeVars( PsiDirectory dir, String fqnExtended, Function<PsiTypeParameter,String> processor )
{
  boolean alt = false;
  DumbService dumbService = DumbService.getInstance( dir.getProject() );
  if( dumbService.isDumb() )
  {
    dumbService.setAlternativeResolveEnabled( alt = true );
  }
  try
  {
    PsiClass extendedClass = JavaPsiFacadeEx.getInstanceEx( dir.getProject() ).findClass( fqnExtended );
    if( extendedClass == null )
    {
      return "";
    }
    PsiTypeParameter[] typeParameters = extendedClass.getTypeParameters();
    if( typeParameters.length == 0 )
    {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    sb.append( "<" );
    for( int i = 0; i < typeParameters.length; i++ )
    {
      PsiTypeParameter tp = typeParameters[i];
      if( i > 0 )
      {
        sb.append( ", " );
      }
      sb.append( processor.fun( tp ) );
    }
    sb.append( "> " );
    return sb.toString();
  }
  finally
  {
    if( alt )
    {
      dumbService.setAlternativeResolveEnabled( false );
    }
  }
}
 
開發者ID:manifold-systems,項目名稱:manifold-ij,代碼行數:44,代碼來源:CreateExtensionMethodsClassAction.java


注:本文中的com.intellij.openapi.project.DumbService.setAlternativeResolveEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。