Java 类org.eclipse.jdt.core.manipulation.JavaManipulation 实例源码

项目:Eclipse-Postfix-Code-Completion    文件:JavaPlugin.java   
@Override
public void start(BundleContext context) throws Exception {
    super.start(context);
    fBundleContext= context;

    WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
        @Override
        public IBuffer createBuffer(ICompilationUnit workingCopy) {
            ICompilationUnit original= workingCopy.getPrimary();
            IResource resource= original.getResource();
            if (resource instanceof IFile)
                return new DocumentAdapter(workingCopy, (IFile) resource);
            return DocumentAdapter.NULL;
        }
    });

    ensurePreferenceStoreBackwardsCompatibility();

    // make sure org.eclipse.jdt.core.manipulation is loaded too
    // can be removed if JavaElementPropertyTester is moved down to jdt.core (bug 127085)
    JavaManipulation.class.toString();

    if (PlatformUI.isWorkbenchRunning()) {
        // Initialize AST provider
        getASTProvider();

        fThemeListener= new IPropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
                if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty()))
                    JavaUIPreferenceInitializer.setThemeBasedPreferences(PreferenceConstants.getPreferenceStore(), true);
            }
        };
        PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener);
        new InitializeAfterLoadJob().schedule(); // last call in start, see bug 191193
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaPlugin.java   
@Override
public void start(BundleContext context) throws Exception {
    super.start(context);

    WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
        @Override
        public IBuffer createBuffer(ICompilationUnit workingCopy) {
            ICompilationUnit original= workingCopy.getPrimary();
            IResource resource= original.getResource();
            if (resource instanceof IFile)
                return new DocumentAdapter(workingCopy, (IFile) resource);
            return DocumentAdapter.NULL;
        }
    });

    ensurePreferenceStoreBackwardsCompatibility();

    // make sure org.eclipse.jdt.core.manipulation is loaded too
    // can be removed if JavaElementPropertyTester is moved down to jdt.core (bug 127085)
    JavaManipulation.class.toString();

    if (PlatformUI.isWorkbenchRunning()) {
        // Initialize AST provider
        getASTProvider();

        fThemeListener= new IPropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
                if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty()))
                    JavaUIPreferenceInitializer.setThemeBasedPreferences(PreferenceConstants.getPreferenceStore(), true);
            }
        };
        PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener);
        new InitializeAfterLoadJob().schedule(); // last call in start, see bug 191193
    }
}
项目:eclipse.jdt.ls    文件:TokenScanner.java   
private IStatus createError(int code, String message, Throwable e) {
    return new Status(IStatus.ERROR, JavaManipulation.ID_PLUGIN, code, message, e);
}