本文整理汇总了Java中org.eclipse.core.runtime.CoreException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java CoreException.printStackTrace方法的具体用法?Java CoreException.printStackTrace怎么用?Java CoreException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.CoreException
的用法示例。
在下文中一共展示了CoreException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeTypesFromMarkers
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
private static void removeTypesFromMarkers() {
for (final IResource iResource : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
boolean isClosed = false;
try {
if (!((IProject) iResource).isOpen()) {
isClosed = true;
((IProject) iResource).open(new NullProgressMonitor());
}
for (IMarker iMarker : MarkerFactory.findMarkersAsArrayList(iResource)) {
if (MarkUtilities.getType(iMarker) != null) {
if (AlloyUtilities.getTotalTargetCount(iMarker) != 0) {
iMarker = AnnotationFactory.convertAnnotationType(iMarker, false, true,
AlloyUtilities.getTotalTargetCount(iMarker));
}
MarkUtilities.setType(iMarker, null);
AlloyUtilities.removeTypeFromMarker(iMarker);
}
}
if (isClosed == true) {
((IProject) iResource).close(new NullProgressMonitor());
}
} catch (final CoreException e) {
e.printStackTrace();
}
}
}
示例2: findMarkersAsArrayList
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
/**
* Returns a list of a resources markers
*
* @param resource
* @return
*/
public static ArrayList<IMarker> findMarkersAsArrayList(final IResource resource) {
try {
if (resource == null) {
return new ArrayList<>();
}
final ArrayList<IMarker> myMarkerList = new ArrayList<>();
IMarker[] list;
list = resource.findMarkers(MarkerFactory.MARKER_MARKING, true, IResource.DEPTH_INFINITE);
for (final IMarker iMarker : list) {
myMarkerList.add(iMarker);
}
return myMarkerList;
} catch (final CoreException e) {
e.printStackTrace();
}
return new ArrayList<>();
}
示例3: mkdirs
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
private static void mkdirs(IFolder destPath) {
IContainer parent = destPath.getParent();
if (! parent.exists()) {
if (parent instanceof IFolder) {
mkdirs((IFolder) parent);
}
else if (parent instanceof IProject) {
mkdirs( ((IProject)parent).getFolder(".") );
}
}
try {
destPath.create(/*force*/true, /*local*/true, Constants.NULL_PROGRESS_MONITOR);
} catch (CoreException e) {
e.printStackTrace();
}
}
示例4: createInfoMarkers
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
private void createInfoMarkers(CompiledContract contract, IFile file) {
if (contract.getEvm() == null || contract.getEvm().getGasEstimates() == null) {
return;
}
GasEstimates gasEstimates = contract.getEvm().getGasEstimates();
SolcIssue solcIssue = new SolcIssue();
solcIssue.setIFile(file);
solcIssue.setLineNumber(1);
solcIssue.setSeverity(Severity.INFO);
String message = prettyPrint(gasEstimates);
solcIssue.setMessage(message);
solcIssue.setErrorCode(createErrorCodeFromMessage(Severity.INFO, message));
EObject element = getEObject(file, 0);
solcIssue.setUriToProblem(EcoreUtil.getURI(element));
try {
super.createMarker(solcIssue, file, NORMAL_VALIDATION);
} catch (CoreException e) {
e.printStackTrace();
}
}
示例5: setLinenumber
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static void setLinenumber(final IMarker iMarker, final int linenumber) {
try {
iMarker.setAttribute(IMarker.LOCATION, linenumber);
} catch (final CoreException e) {
e.printStackTrace();
}
}
示例6: setEnd
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static void setEnd(final IMarker iMarker, final int end) {
try {
iMarker.setAttribute(IMarker.CHAR_END, end);
} catch (final CoreException e) {
e.printStackTrace();
}
}
示例7: getText
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static String getText(final IMarker iMarker) {
try {
return (String) iMarker.getAttribute(IMarker.TEXT);
} catch (final CoreException e) {
e.printStackTrace();
}
return null;
}
示例8: getType
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static String getType(final IMarker iMarker) {
try {
return (String) iMarker.getAttribute(MarkUtilities.MARKER_TYPE);
} catch (final CoreException e) {
e.printStackTrace();
}
return null;
}
示例9: initializeFrom
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
for (EngineAddonSpecificationExtension extension : _components.keySet()) {
try {
boolean value = configuration.getAttribute(extension.getName(), false);
// _componentsActive.put(extension, value);
Button checkbox = _components.get(extension);
checkbox.setSelection(value);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:15,代码来源:LaunchConfigurationDataProcessingTab.java
示例10: deleteFile
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
private void deleteFile(IFile occieFile, String extension) {
IPath ecorePath = occieFile.getFullPath().removeFileExtension().addFileExtension(extension);
IFile ecoreFile = ResourcesPlugin.getWorkspace().getRoot().getFile(ecorePath);
if(ecoreFile.exists()) {
try {
ecoreFile.delete(true, null);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
示例11: getElements
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
@SuppressWarnings("restriction")
@Override
public QuickAccessElement[] getElements() {
List<QuickAccessElement> elements = new ArrayList<QuickAccessElement>();
try {
ILaunchConfiguration[] launchConfigurations = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
for (ILaunchConfiguration configuration : launchConfigurations) {
elements.add(new LauncherElement(this, configuration.getMemento(), configuration.getName(), configuration.getType().getName()));
}
} catch (CoreException e) {
e.printStackTrace();
}
return elements.toArray(new QuickAccessElement[] {});
}
示例12: getElementForId
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
@Override
public QuickAccessElement getElementForId(String id) {
try {
ILaunchConfiguration configuration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(id);
return new LauncherElement(this, configuration.getMemento(), configuration.getName(), configuration.getType().getName());
} catch (CoreException e) {
e.printStackTrace();
}
return null;
}
示例13: getLength
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static int getLength(final IMarker iMarker) {
try {
return (int) iMarker.getAttribute(IMarker.CHAR_END) - MarkUtilities.getStart(iMarker);
} catch (final CoreException e) {
e.printStackTrace();
}
return -1;
}
示例14: testNoErrorsInWorkspace
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
@Test
public void testNoErrorsInWorkspace(){
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject iProject : projects) {
try {
IMarker[] markers = iProject.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
for (IMarker iMarker : markers) {
assertFalse("Unexpected marker: " + iMarker.getAttribute(IMarker.MESSAGE), iMarker.getAttribute(IMarker.SEVERITY).equals(IMarker.SEVERITY_ERROR));
}
} catch (CoreException e) {
e.printStackTrace();
}
}
}
示例15: setType
import org.eclipse.core.runtime.CoreException; //导入方法依赖的package包/类
public static void setType(final IMarker iMarker, final String type) {
try {
iMarker.setAttribute(MarkUtilities.MARKER_TYPE, type);
MarkUtilities.setMessage(iMarker, type);
} catch (final CoreException e) {
e.printStackTrace();
}
}