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