Refine search
if (!path.toFile().exists()) { String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString()); throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, null)); } catch (FileNotFoundException e) { String msg = NLS.bind(PrefsMessages.preferences_fileNotFound, path.toOSString()); throw new CoreException(new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, 1, msg, e)); } finally { if (input != null)
} catch (IOException e) { String message = NLS.bind(PrefsMessages.preferences_errorWriting, file, e.getMessage()); IStatus status = new Status(IStatus.ERROR, PrefsMessages.OWNER_NAME, IStatus.ERROR, message, e); throw new CoreException(status); } finally { if (output != null)
public static void setDefault(IRegistryProvider provider) throws CoreException { if (defaultRegistryProvider != null) { Status status = new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, RegistryMessages.registry_default_exists, null); throw new CoreException(status); } defaultRegistryProvider = provider; }
public static void setDefault(IRegistryProvider provider) throws CoreException { if (defaultRegistryProvider != null) { Status status = new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, RegistryMessages.registry_default_exists, null); throw new CoreException(status); } defaultRegistryProvider = provider; }
public void throwParseErrorsException(Throwable e) throws CoreException { Status status = new Status(IStatus.ERROR, PDECore.PLUGIN_ID, IStatus.OK, "Error in the manifest file", //$NON-NLS-1$ e); throw new CoreException(status); }
/** * Throws a core exception. * * @param message message * @param e underlying exception or <code>null</code> * @throws CoreException */ protected void abort(String message, Throwable e) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, message, e)); }
private static void throwWriteException(Throwable t) throws CoreException { // IStatus status= JavaUIStatus.createError(IJavaStatusConstants.TEMPLATE_IO_EXCEPTION, // TemplateMessages.getString("TemplateSet.error.write"), t); //$NON-NLS-1$ // throw new JavaUIException(status); throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jface.text", TEMPLATE_IO_EXCEPTION, JavaTemplateMessages.TemplateSet_error_write, t)); //$NON-NLS-1$ }
/** * Throws a core exception with the given message and underlying exception (possibly * <code>null</code>). * * @param message message * @param e underlying cause of the exception or <code>null</code> * @throws CoreException */ private void abort(String message, Exception e) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, message, e)); }
protected void throwCoreException(InvocationTargetException e) throws CoreException { String message = e.getTargetException().getMessage(); if (message != null && message.length() > 0) { throw new CoreException(new Status( IStatus.ERROR, PDECore.PLUGIN_ID, IStatus.ERROR, message, null)); } }
public IClasspathContainerPage createPage() throws CoreException { if (fPage == null) { Object elem= CoreUtility.createExtension(fConfigElement, ATT_PAGE_CLASS); if (elem instanceof IClasspathContainerPage) { fPage= (IClasspathContainerPage) elem; } else { String id= fConfigElement.getAttribute(ATT_ID); throw new CoreException(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, 0, "Invalid extension (page not of type IClasspathContainerPage): " + id, null)); //$NON-NLS-1$ } } return fPage; }
protected IQueryParticipant create() throws CoreException { try { return (IQueryParticipant) fConfigurationElement.createExecutableExtension(CLASS); } catch (ClassCastException e) { throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, SearchMessages.SearchParticipant_error_classCast, e)); } }
@Override public IViewPart createView() throws CoreException { if (element == null) { throw new CoreException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, "Unable to create an e4 view of id " + descriptor.getElementId())); //$NON-NLS-1$ } return (IViewPart) element.createExecutableExtension("class"); //$NON-NLS-1$ }
public void run(IProgressMonitor monitor) throws CoreException { try { doValidate(helper, reporter); } catch (ValidationException e) { throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID_JSP_CORE, 0, PLUGIN_ID_JSP_CORE, e)); } } };
private CoreException wrapBadPositionCategoryException(BadPositionCategoryException e) { String message= e.getMessage(); if (message == null) message= "BadPositionCategoryException"; //$NON-NLS-1$ return new CoreException(new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, 0, message, e)); }
public LogicalStructureProvider(IConfigurationElement element) throws CoreException { fConfigurationElement= element; fModelIdentifier= fConfigurationElement.getAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER); if (fModelIdentifier == null) { throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LogicalStructureProvider_0, null)); } String className= fConfigurationElement.getAttribute(IConfigurationElementConstants.CLASS); if (className == null) { throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LogicalStructureProvider_1, null)); } }
public void doRefresh(final BuildServer server, final IOperationMonitor monitor) throws CoreException { Object result = BuildRunner.run(new BuildRunnableWithResult<BuildServerConfiguration>() { @Override public BuildServerConfiguration run() throws CoreException { return server.getBehaviour().refreshConfiguration(monitor); } }); if (result == null) { throw new CoreException(new Status(IStatus.ERROR, BuildsCorePlugin.ID_PLUGIN, "Server did not provide a valid configuration.")); } }
public void move(IPath oldPath, IPath newPath) throws CoreException { File oldFile = getFile(oldPath, false); // TODO lock hierarchy and throw an exception if oldFile is in use if (oldFile.exists()) { File newFile = getFile(newPath, false); newFile.getParentFile().mkdirs(); if (!oldFile.renameTo(newFile)) { throw new CoreException(new Status(IStatus.ERROR, CommonsCorePlugin.ID_PLUGIN, NLS.bind( "The target path ''{0}'' already exists", newPath))); //$NON-NLS-1$ } } }
private void loadFromExtension() throws CoreException { String identifier = configElement.getAttribute(ATT_ID); label = configElement.getAttribute(ATT_NAME); className = configElement.getAttribute(ATT_CLASS); description = configElement.getAttribute(ATT_DESCRIPTION); // Sanity check. if ((label == null) || (className == null) || (identifier == null) || (description == null)) { throw new CoreException(new Status(IStatus.ERROR, configElement.getContributor().getName(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$ null)); } id = identifier; }
@Override public InputStream getContents() throws CoreException { try { return new ByteArrayInputStream(text.getBytes(getCharset())); } catch (UnsupportedEncodingException e) { throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.JavaPlugin_internal_error, e)); } } @Override
@Override public Object create() throws CoreException { if (HELP_MENU_ACTION.equals(id)) return configure(new CheatSheetHelpMenuAction()); throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.ui.cheatsheets", //$NON-NLS-1$ 0, "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ }