Java 类org.eclipse.ui.texteditor.ITextEditorExtension4 实例源码

项目:team-explorer-everywhere    文件:AnnotateCommand.java   
private void showChangeBlocks(final IResource r, final IEditorPart editor, final Block[] blocks) {
    if (editor instanceof ITextEditorExtension4) {
        final ITextEditorExtension4 diffExt = (ITextEditorExtension4) editor;
        Object info;
        try {
            info = buildRevisionInfo(blocks);
            if (info != null) {
                final Method showRevInfo = diffExt.getClass().getMethod("showRevisionInformation", new Class[] //$NON-NLS-1$
                {
                    info.getClass(),
                    String.class
                });
                // diffExt.showRevisionInformation(info,
                // TfsItemReferenceprovider.ID);
                showRevInfo.invoke(diffExt, new Object[] {
                    info,
                    TFSItemReferenceProvider.ID
                });
            }
        } catch (final Exception e) {
            e.printStackTrace();
            MessageDialog.openError(
                shell,
                Messages.getString("AnnotateCommand.UpdateErrorDialogTitle"), //$NON-NLS-1$
                e.getMessage());
        }
    }
}