Search in sources :

Example 1 with MergeViewResolveAction

use of com.collabnet.subversion.merge.actions.MergeViewResolveAction in project subclipse by subclipse.

the class MergeConflictsCompareInput method markResolved.

private void markResolved() {
    if (!resolved || mergeResult == null)
        return;
    MergeViewResolveAction resolveAction = new MergeViewResolveAction();
    resolveAction.setShowDialog(false);
    resolveAction.setResolution(resolution);
    IStructuredSelection selection = new IStructuredSelection() {

        public Object getFirstElement() {
            return mergeResult;
        }

        public Iterator iterator() {
            return toList().iterator();
        }

        public int size() {
            return 1;
        }

        public Object[] toArray() {
            MergeResult[] mergeResults = { mergeResult };
            return mergeResults;
        }

        public List toList() {
            List mergeResults = new ArrayList();
            mergeResults.add(mergeResult);
            return mergeResults;
        }

        public boolean isEmpty() {
            return false;
        }
    };
    resolveAction.selectionChanged(null, selection);
    resolveAction.run(null);
}
Also used : MergeViewResolveAction(com.collabnet.subversion.merge.actions.MergeViewResolveAction) MergeResult(com.collabnet.subversion.merge.MergeResult) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

MergeResult (com.collabnet.subversion.merge.MergeResult)1 MergeViewResolveAction (com.collabnet.subversion.merge.actions.MergeViewResolveAction)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1