Package com.intellij.openapi.diff

Examples of com.intellij.openapi.diff.MergeRequest


    private void showSourceDiffDialog(final String databaseContent, final SourceCodeFile virtualFile, final Editor editor) {
        new SimpleLaterInvocator() {
            public void execute() {
                DiffRequestFactory diffRequestFactory = new DiffRequestFactoryImpl();
                MergeRequest mergeRequest = diffRequestFactory.createMergeRequest(
                        databaseContent,
                        virtualFile.getContent(),
                        virtualFile.getLastSavedContent(),
                        virtualFile,
                        virtualFile.getProject(),
                        ActionButtonPresentation.APPLY,
                        ActionButtonPresentation.CANCEL_WITH_PROMPT);
                mergeRequest.setVersionTitles(new String[]{"Database version", "Merge result", "Your version"});
                final DBSchemaObject object = virtualFile.getObject();
                mergeRequest.setWindowTitle("Version conflict resolution for " + object.getQualifiedNameWithType());

                DiffManager.getInstance().getDiffTool().show(mergeRequest);

                int result = mergeRequest.getResult();
                if (result == 0) {
                    doUpdateSourceToDatabase(object, virtualFile, editor);
                    //sourceCodeEditor.afterSave();
                } else if (result == 1) {
                    new WriteActionRunner() {
View Full Code Here

TOP

Related Classes of com.intellij.openapi.diff.MergeRequest

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.