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


Java JavaModelUtil.isExceptionToBeLogged方法代码示例

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


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

示例1: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	if (!selection.isEmpty()) {
		if (ReorgUtils.containsOnlyProjects(selection.toList())) {
			setEnabled(createWorkbenchAction(selection).isEnabled());
			return;
		}
		try {
			List<?> elements= selection.toList();
			IResource[] resources= ReorgUtils.getResources(elements);
			IJavaElement[] javaElements= ReorgUtils.getJavaElements(elements);
			if (elements.size() != resources.length + javaElements.length)
				setEnabled(false);
			else
				setEnabled(RefactoringAvailabilityTester.isMoveAvailable(resources, javaElements));
		} catch (JavaModelException e) {
			// no ui here - this happens on selection changes
			// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
			if (JavaModelUtil.isExceptionToBeLogged(e))
				JavaPlugin.log(e);
			setEnabled(false);
		}
	} else
		setEnabled(false);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:ReorgMoveAction.java

示例2: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(JavaTextSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isIntroduceParameterObjectAvailable(selection));
	} catch (JavaModelException e) {
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:11,代码来源:IntroduceParameterObjectAction.java

示例3: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
/**
 * Note: This method is for internal use only. Clients should not call this method.
 * 
 * @param selection the Java text selection
 * @noreference This method is not intended to be referenced by clients.
 */
@Override
public void selectionChanged(JavaTextSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isSelfEncapsulateAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);//no UI
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:18,代码来源:SelfEncapsulateFieldAction.java

示例4: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(canEnable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:AddGetterSetterAction.java

示例5: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isIntroduceParameterObjectAvailable(selection));
	} catch (JavaModelException e) {
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:IntroduceParameterObjectAction.java

示例6: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isIntroduceIndirectionAvailable(selection));
	} catch (JavaModelException e) {
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:10,代码来源:IntroduceIndirectionAction.java

示例7: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isChangeSignatureAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);//no UI here - happens on selection changes
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:12,代码来源:ModifyParametersAction.java

示例8: findType

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private IJavaElement findType(ICompilationUnit cu, boolean silent) {
	IType[] types= null;
	try {
		types= cu.getAllTypes();
	} catch (JavaModelException ex) {
		if (JavaModelUtil.isExceptionToBeLogged(ex))
			ExceptionHandler.log(ex, SearchMessages.JavaElementAction_error_open_message);
		if (silent)
			return RETURN_WITHOUT_BEEP;
		else
			return null;
	}
	if (types.length == 1 || (silent && types.length > 0))
		return types[0];
	if (silent)
		return RETURN_WITHOUT_BEEP;
	if (types.length == 0)
		return null;
	String title= SearchMessages.JavaElementAction_typeSelectionDialog_title;
	String message = SearchMessages.JavaElementAction_typeSelectionDialog_message;
	int flags= (JavaElementLabelProvider.SHOW_DEFAULT);

	ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(flags));
	dialog.setTitle(title);
	dialog.setMessage(message);
	dialog.setElements(types);

	if (dialog.open() == Window.OK)
		return (IType)dialog.getFirstResult();
	else
		return RETURN_WITHOUT_BEEP;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:33,代码来源:FindAction.java

示例9: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isGeneralizeTypeAvailable(selection));
	} catch (JavaModelException e) {
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ChangeTypeAction.java

示例10: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isInlineConstantAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);//no ui
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:12,代码来源:InlineConstantAction.java

示例11: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isReplaceInvocationsAvailable(selection));
	} catch (JavaModelException e) {
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:ReplaceInvocationsAction.java

示例12: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isUseSuperTypeAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (!(e.getException() instanceof CharConversionException) && JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);// no UI - happens on selection changes
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:UseSupertypeAction.java

示例13: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void selectionChanged(final IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isExtractSupertypeAvailable(selection));
	} catch (JavaModelException exception) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (!(exception.getException() instanceof CharConversionException) && JavaModelUtil.isExceptionToBeLogged(exception))
			JavaPlugin.log(exception);
		setEnabled(false);//no UI - happens on selection changes
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:15,代码来源:ExtractSuperClassAction.java

示例14: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isPushDownAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);// no UI
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:PushDownAction.java

示例15: selectionChanged

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
@Override
public void selectionChanged(IStructuredSelection selection) {
	try {
		setEnabled(RefactoringAvailabilityTester.isMoveMethodAvailable(selection));
	} catch (JavaModelException e) {
		// http://bugs.eclipse.org/bugs/show_bug.cgi?id=19253
		if (JavaModelUtil.isExceptionToBeLogged(e))
			JavaPlugin.log(e);
		setEnabled(false);//no ui
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:12,代码来源:MoveInstanceMethodAction.java


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