Search in sources :

Example 1 with MergeWizardDialog

use of com.collabnet.subversion.merge.wizards.MergeWizardDialog in project subclipse by subclipse.

the class MergeConflictsCompareInput method handleExternalDispose.

public void handleExternalDispose() {
    DialogWizard dialogWizard = new DialogWizard(DialogWizard.FINISHED_EDITING);
    dialogWizard.setConflictDescriptor(conflictDescriptor);
    MergeWizardDialog dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard);
    dialog.open();
    // resolved = dialogWizard.isConflictResolved();
    resolution = dialogWizard.getResolution();
    resolved = resolution != ISVNConflictResolver.Choice.postpone;
    finished = true;
    markResolved();
}
Also used : DialogWizard(com.collabnet.subversion.merge.wizards.DialogWizard) MergeWizardDialog(com.collabnet.subversion.merge.wizards.MergeWizardDialog)

Example 2 with MergeWizardDialog

use of com.collabnet.subversion.merge.wizards.MergeWizardDialog in project subclipse by subclipse.

the class MergeConflictsCompareInput method handleInternalDispose.

protected void handleInternalDispose() {
    DialogWizard dialogWizard = new DialogWizard(DialogWizard.FINISHED_EDITING);
    dialogWizard.setConflictDescriptor(conflictDescriptor);
    MergeWizardDialog dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard);
    dialog.open();
    // resolved = dialogWizard.isConflictResolved();
    resolution = dialogWizard.getResolution();
    resolved = resolution != ISVNConflictResolver.Choice.postpone;
    finished = true;
    markResolved();
}
Also used : DialogWizard(com.collabnet.subversion.merge.wizards.DialogWizard) MergeWizardDialog(com.collabnet.subversion.merge.wizards.MergeWizardDialog)

Example 3 with MergeWizardDialog

use of com.collabnet.subversion.merge.wizards.MergeWizardDialog in project subclipse by subclipse.

the class SVNConflictResolver method finishEditing.

private void finishEditing(SVNConflictDescriptor descrip) {
    DialogWizard dialogWizard = new DialogWizard(DialogWizard.FINISHED_EDITING);
    dialogWizard.setConflictDescriptor(descrip);
    MergeWizardDialog dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard);
    dialog.open();
    try {
        copyFile(workingTempFile, mergedFile);
    } catch (IOException e) {
        e.printStackTrace();
    }
    // resolved = dialogWizard.isConflictResolved();
    resolution = dialogWizard.getResolution();
    // resolved = resolution != ISVNConflictResolver.Choice.postpone;
    finished = true;
}
Also used : DialogWizard(com.collabnet.subversion.merge.wizards.DialogWizard) IOException(java.io.IOException) MergeWizardDialog(com.collabnet.subversion.merge.wizards.MergeWizardDialog)

Example 4 with MergeWizardDialog

use of com.collabnet.subversion.merge.wizards.MergeWizardDialog in project subclipse by subclipse.

the class ResumeMergeAction method run.

public void run(IAction action) {
    DialogWizard dialogWizard = new DialogWizard(DialogWizard.RESUME_MERGE);
    MergeWizardDialog dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard);
    if (dialog.open() == MergeWizardDialog.CANCEL)
        return;
    Iterator iter = fSelection.iterator();
    while (iter.hasNext()) {
        Object selectedObject = iter.next();
        if (selectedObject instanceof MergeOutput) {
            MergeOutput mergeOutput = (MergeOutput) selectedObject;
            mergeOutput.resume();
        }
    }
}
Also used : Iterator(java.util.Iterator) MergeOutput(com.collabnet.subversion.merge.MergeOutput) DialogWizard(com.collabnet.subversion.merge.wizards.DialogWizard) MergeWizardDialog(com.collabnet.subversion.merge.wizards.MergeWizardDialog)

Example 5 with MergeWizardDialog

use of com.collabnet.subversion.merge.wizards.MergeWizardDialog in project subclipse by subclipse.

the class UndoMergeAction method run.

public void run(IAction action) {
    DialogWizard dialogWizard = new DialogWizard(DialogWizard.UNDO_MERGE_WARNING);
    MergeWizardDialog dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard, true);
    if (dialog.open() == MergeWizardDialog.CANCEL)
        return;
    final ArrayList resources = new ArrayList();
    ArrayList mergeOutputs = new ArrayList();
    Iterator iter = fSelection.iterator();
    while (iter.hasNext()) {
        Object object = iter.next();
        if (object instanceof MergeOutput) {
            MergeOutput mergeOutput = (MergeOutput) object;
            mergeOutputs.add(mergeOutput);
            IResource resource = mergeOutput.getResource();
            resources.add(resource);
        }
    }
    final IResource[] resourceArray = new IResource[resources.size()];
    resources.toArray(resourceArray);
    UndoMergeOperation undoMergeOperation = new UndoMergeOperation(MergeResultsView.getView(), resourceArray);
    try {
        undoMergeOperation.run();
    } catch (Exception e) {
        Activator.handleError(Messages.UndoMergeAction_error, e);
        MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.UndoMergeAction_title, e.getMessage());
        return;
    }
    iter = mergeOutputs.iterator();
    while (iter.hasNext()) {
        MergeOutput mergeOutput = (MergeOutput) iter.next();
        mergeOutput.delete();
    }
    MergeResultsView.getView().refresh();
    dialogWizard = new DialogWizard(DialogWizard.UNDO_MERGE_COMPLETED);
    dialog = new MergeWizardDialog(Display.getDefault().getActiveShell(), dialogWizard, true);
    if (dialog.open() == MergeWizardDialog.CANCEL)
        return;
    RevertAction revertAction = new RevertAction();
    revertAction.setShowNothingToRevertMessage(false);
    IStructuredSelection selection = new IStructuredSelection() {

        public Object getFirstElement() {
            return resourceArray[0];
        }

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

        public int size() {
            return resourceArray.length;
        }

        public Object[] toArray() {
            return resourceArray;
        }

        public List toList() {
            return resources;
        }

        public boolean isEmpty() {
            return resources.isEmpty();
        }
    };
    revertAction.selectionChanged(null, selection);
    revertAction.run(null);
}
Also used : RevertAction(org.tigris.subversion.subclipse.ui.actions.RevertAction) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) MergeOutput(com.collabnet.subversion.merge.MergeOutput) DialogWizard(com.collabnet.subversion.merge.wizards.DialogWizard) UndoMergeOperation(com.collabnet.subversion.merge.UndoMergeOperation) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) MergeWizardDialog(com.collabnet.subversion.merge.wizards.MergeWizardDialog) IResource(org.eclipse.core.resources.IResource)

Aggregations

DialogWizard (com.collabnet.subversion.merge.wizards.DialogWizard)8 MergeWizardDialog (com.collabnet.subversion.merge.wizards.MergeWizardDialog)8 MergeOutput (com.collabnet.subversion.merge.MergeOutput)3 ArrayList (java.util.ArrayList)3 Iterator (java.util.Iterator)3 IResource (org.eclipse.core.resources.IResource)3 IOException (java.io.IOException)2 SVNException (org.tigris.subversion.subclipse.core.SVNException)2 MergeResult (com.collabnet.subversion.merge.MergeResult)1 MergeResultsFolder (com.collabnet.subversion.merge.MergeResultsFolder)1 UndoMergeOperation (com.collabnet.subversion.merge.UndoMergeOperation)1 MergeEditConflictsAction (com.collabnet.subversion.merge.actions.MergeEditConflictsAction)1 ExternalFileEditorInput (com.collabnet.subversion.merge.editors.ExternalFileEditorInput)1 MergeResultsView (com.collabnet.subversion.merge.views.MergeResultsView)1 File (java.io.File)1 List (java.util.List)1 IFileStore (org.eclipse.core.filesystem.IFileStore)1 Path (org.eclipse.core.runtime.Path)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1