public static void logErrorMessage(String message) { log(new Status( IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, null)); }
public static void log(Throwable e) { if (e instanceof InvocationTargetException) e = ((InvocationTargetException) e).getTargetException(); IStatus status = null; if (e instanceof CoreException || e.getMessage() != null) { status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e); } log(status); }
public static void logException(Throwable e, String message) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } IStatus status = null; if (e instanceof CoreException) { status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, e); } else { if (message == null) message = e.getMessage(); if (message == null) message = e.toString(); status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, e); } log(status); }
public static boolean hasPluginNature(IProject project) { try { return project.hasNature(PLUGIN_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public static boolean hasPluginNature(IProject project) { try { return project.hasNature(PLUGIN_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public static boolean hasUpdateSiteNature(IProject project) { try { return project.hasNature(SITE_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public static boolean hasFeatureNature(IProject project) { try { return project.hasNature(FEATURE_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public static boolean hasUpdateSiteNature(IProject project) { try { return project.hasNature(SITE_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public static boolean hasFeatureNature(IProject project) { try { return project.hasNature(FEATURE_NATURE); } catch (CoreException e) { PDECore.log(e); return false; } }
public Object createAdapterChild(FileAdapter parent, File file) { if (!file.isDirectory()) { String name = file.getName().toLowerCase(Locale.ENGLISH); try { if (name.endsWith(".jar")) { //$NON-NLS-1$ IPackageFragmentRoot root = findPackageFragmentRoot(new Path(file.getAbsolutePath())); if (root != null) return root; } } catch (CoreException e) { PDECore.log(e); } } return new FileAdapter(parent, file, this); }
@Override public IEclipsePreferences preApply(IEclipsePreferences node) { try { node.accept(new Visitor()); } catch (BackingStoreException e) { PDECore.log(e); } return node; } }
@Override public void load(InputStream source, boolean outOfSync) { try { setLoaded(true); // Must be set before loading the manifest otherwise calls to getModel() cause a stack overflow fBundle.load(ManifestElement.parseBundleManifest(source, null)); if (!outOfSync) updateTimeStamp(); } catch (BundleException e) { PDECore.log(e); } catch (IOException e) { PDECore.log(e); } }
public SearchablePluginsManager getSearchablePluginsManager() { if (fSearchablePluginsManager == null) { fSearchablePluginsManager = new SearchablePluginsManager(); try { getWorkspace().addSaveParticipant(inst, fSearchablePluginsManager); } catch (CoreException e) { log(e); } } return fSearchablePluginsManager; }
private void touchProject(IProject project) { if (WorkspaceModelManager.isPluginProject(project) && !WorkspaceModelManager.isBinaryProject(project)) { try { // set session property on project // to be read and reset in ManifestConsistencyChecker project.setSessionProperty(PDECore.TOUCH_PROJECT, Boolean.TRUE); // touch project so that ManifestConsistencyChecker#build(..) gets invoked project.touch(new NullProgressMonitor()); } catch (CoreException e) { PDECore.log(e); } } }
public static void deleteMarkers(TocModel model) { try { IMarker[] problems = model.getUnderlyingResource().findMarkers( IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); if (problems != null) { for (int index = 0; index < problems.length; index++) { problems[index].delete(); } } } catch (CoreException e) { PDECore.log(e); } }
private void touchProject(IProject project) { if (WorkspaceModelManager.isPluginProject(project) && !WorkspaceModelManager.isBinaryProject(project)) { try { // set session property on project // to be read and reset in ManifestConsistencyChecker project.setSessionProperty(PDECore.TOUCH_PROJECT, Boolean.TRUE); // touch project so that ManifestConsistencyChecker#build(..) gets invoked project.touch(new NullProgressMonitor()); } catch (CoreException e) { PDECore.log(e); } } }
public void addBundle(IPluginModelBase model, boolean update) { if (model == null) return; BundleDescription desc = model.getBundleDescription(); long bundleId = desc == null || !update ? -1 : desc.getBundleId(); try { model.setBundleDescription( addBundle(new File(model.getInstallLocation()), bundleId)); } catch (IOException e) { } catch (PluginConversionException e) { } catch (CoreException e) { PDECore.log(e); } }
public static void deleteMarkers(TocModel model) { try { if (model.getUnderlyingResource() == null) { return; } IMarker[] problems = model.getUnderlyingResource().findMarkers( IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); if (problems != null) { for (IMarker problem : problems) { problem.delete(); } } } catch (CoreException e) { PDECore.log(e); } }
public void addBundle(IPluginModelBase model, boolean update) { if (model == null) return; BundleDescription desc = model.getBundleDescription(); long bundleId = desc == null || !update ? -1 : desc.getBundleId(); try { BundleDescription newDesc = addBundle(new File(model.getInstallLocation()), bundleId); model.setBundleDescription(newDesc); if (newDesc == null && update) fState.removeBundle(desc); } catch (CoreException e) { PDECore.log(e); model.setBundleDescription(null); } }