/*******************************************************************************
 * Copyright (c) 2006-2008 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Bastian Doetsch
 *******************************************************************************/
package com.vectrace.MercurialEclipse.menu;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.WizardDialog;

import com.vectrace.MercurialEclipse.team.cache.LocalChangesetCache;
import com.vectrace.MercurialEclipse.wizards.TransplantWizard;

public class TransplantHandler extends SingleResourceHandler {

    @Override
    protected void run(IResource resource) throws Exception {
        IProject project = resource.getProject();        
        TransplantWizard transplantWizard = new TransplantWizard(project);                       
        WizardDialog transplantWizardDialog = new WizardDialog(getShell(),transplantWizard);
        transplantWizardDialog.open();
        LocalChangesetCache.getInstance().refreshAllLocalRevisions(project, true);
    }

}

/*******************************************************************************
 * Copyright (c) 2006-2008 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Bastian Doetsch
 *******************************************************************************/
package com.vectrace.MercurialEclipse.menu;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;

import com.vectrace.MercurialEclipse.team.cache.RefreshJob;
import com.vectrace.MercurialEclipse.wizards.TransplantWizard;

public class TransplantHandler extends SingleResourceHandler {

    @Override
    protected void run(IResource resource) throws Exception {
        IProject project = resource.getProject();
        TransplantWizard transplantWizard = new TransplantWizard(project);
        WizardDialog transplantWizardDialog = new WizardDialog(getShell(),transplantWizard);
        int result = transplantWizardDialog.open();
        if (result == Window.OK) {
            new RefreshJob("Refresh after transplant", project, RefreshJob.LOCAL_AND_OUTGOING).schedule();
        }
    }

}

Fix for issue #10473 and issue #10474: there should be cache refresh after transplant operation.