本文整理匯總了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;
}
示例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));
}
}
}
示例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 );
}
}
}