Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.CoreException


              shell.forceActive();
            }
          } catch (PartInitException e) {
            String msg = NLS.bind(IDEWorkbenchMessages.OpenDelayedFileAction_message_errorOnOpen,
                    fileStore.getName());
            CoreException eLog = new PartInitException(e.getMessage());
            IDEWorkbenchPlugin.log(msg, new Status(IStatus.ERROR, IDEApplication.PLUGIN_ID, msg, eLog));
            MessageDialog.open(MessageDialog.ERROR, window.getShell(),
                IDEWorkbenchMessages.OpenDelayedFileAction_title,
                msg, SWT.SHEET);
          }
View Full Code Here


            FileOutputStream out = null;
            try {
                out = new FileOutputStream(propertiesFile);
                props.store(out, new Date().toString());
            } catch (final IOException e) {
                throw new CoreException(new Status(Status.ERROR, NewBuilder.PLUGIN_ID, "Failure to write container source attachments", e));
            } finally {
                IO.close(out);
            }
        }
    }
View Full Code Here

            InputStream in = null;
            try {
                in = new FileInputStream(propertiesFile);
                props.load(in);
            } catch (final IOException e) {
                throw new CoreException(new Status(Status.ERROR, NewBuilder.PLUGIN_ID, "Failure to read container source attachments", e));
            } finally {
                IO.close(in);
            }
        }
View Full Code Here

        } catch (CoreException e) {
            throw e;
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e));
        }
  }
View Full Code Here

                                if (command == null) {
                                    return true;
                                }
                                Result<?> result = command.execute();
                                if (!result.isSuccess()) {
                                    throw new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID,
                                            "Failed exporting: " + result.toString()));
                                }

                                return true;
                            }
View Full Code Here

        throws CoreException
    {
        LdifRecord[] records = getLdifModel().getRecords();
        if ( records.length != 1 || !( records[0] instanceof LdifContentRecord ) )
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, Messages
                .getString( "LdifEntryEditorDocumentProvider.InvalidRecordType" ) ) ); //$NON-NLS-1$
        }
        if ( !records[0].isValid() )
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, NLS.bind( Messages
                .getString( "LdifEntryEditorDocumentProvider.InvalidLdif" ), records[0].getInvalidString() ) ) ); //$NON-NLS-1$
        }
        for ( LdifContainer ldifContainer : getLdifModel().getContainers() )
        {
            if ( ldifContainer instanceof LdifInvalidContainer )
            {
                LdifInvalidContainer cont = ( LdifInvalidContainer ) ldifContainer;
                throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, NLS.bind( Messages
                    .getString( "LdifEntryEditorDocumentProvider.InvalidLdif" ), cont.getInvalidString() ) ) ); //$NON-NLS-1$
            }
        }

        EntryEditorInput input = getEntryEditorInput( element );
        try
        {
            LdapDN newDN = new LdapDN( records[0].getDnLine().getValueAsString() );
            if ( !newDN.equals( input.getResolvedEntry().getDn() ) )
            {
                throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, NLS.bind( Messages
                    .getString( "LdifEntryEditorDocumentProvider.ModDnNotSupported" ), records[0].getInvalidString() ) ) ); //$NON-NLS-1$
            }
        }
        catch ( InvalidNameException e )
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, Messages
                .getString( "LdifEntryEditorDocumentProvider.InvalidDN" ) ) ); //$NON-NLS-1$
        }

        IStatus status = input.saveSharedWorkingCopy( false, editor );
        if ( status != null && !status.isOK() )
        {
            BrowserUIPlugin.getDefault().getLog().log( status );
            throw new CoreException( status );
        }
    }
View Full Code Here

            EntryEditorInput input = ( EntryEditorInput ) element;
            return input;
        }
        else
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
                "Expected EntryEditorInput, was " + element ) ); //$NON-NLS-1$
        }
    }
View Full Code Here

                projectDocument = new Document("");
            }
            projectModel = new BndEditModel();
            projectModel.loadFrom(projectDocument);
        } catch (IOException e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, e.getMessage(), e));
        }

        // Check if we need to enable sub-bundles on the project file
        boolean enableSubs;
        List<String> subBndFiles = projectModel.getSubBndFiles();
View Full Code Here

            sourceModel.genericSet(property, null);
        }
    }

    private static CoreException newCoreException(String message, Throwable cause) {
        return new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, message, cause));
    }
View Full Code Here

        try {
            boolean dynamic = configuration.getAttribute(LaunchConstants.ATTR_DYNAMIC_BUNDLES, LaunchConstants.DEFAULT_DYNAMIC_BUNDLES);
            if (dynamic)
                registerLaunchPropertiesRegenerator(model, launch);
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error obtaining OSGi project launcher.", e));
        }

        display = Workbench.getInstance().getDisplay();
        display.syncExec(new Runnable() {
            @Override
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.