diff options
author | Michael Keppler | 2019-03-02 16:30:51 +0000 |
---|---|---|
committer | Michael Keppler | 2019-03-02 16:30:51 +0000 |
commit | f45b668dad534b08f56e5669a38d96d4a33a958f (patch) | |
tree | 9aaa870a01385eed7f52c3b02c30fc07dc26a824 | |
parent | 3a9630f48997c0db84c31a832f020b27059e0509 (diff) | |
download | egit-f45b668dad534b08f56e5669a38d96d4a33a958f.tar.gz egit-f45b668dad534b08f56e5669a38d96d4a33a958f.tar.xz egit-f45b668dad534b08f56e5669a38d96d4a33a958f.zip |
Refresh repositories view after clean command
When cleaning directories or files which are currently visible as nodes
underneath the working tree node, the repositories view must be
refreshed. Since there is no selective refresh for parts of the working
tree, just refresh the complete view at the end of a clean command.
Bug:544755
Change-Id: I0b10ce892afd4cc3ca8b2026da1016d80afd3f6c
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
3 files changed, 28 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java index 8cd3af53cf..0cd9f2c7b7 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java @@ -1207,6 +1207,9 @@ public class UIText extends NLS { public static String CleanRepositoryPage_title; /** */ + public static String CleanRepositoryPage_RefreshingRepositories; + + /** */ public static String CleanWizard_title; /** */ diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java index 01946eb756..43e5b7e0ef 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java @@ -21,10 +21,13 @@ import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.egit.core.internal.util.ProjectUtil; import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.internal.UIText; +import org.eclipse.egit.ui.internal.repository.RepositoriesView; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.jface.operation.IRunnableWithProgress; @@ -47,6 +50,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.UIJob; /** * A page for the Clean wizard presenting all things to be cleaned to the user. @@ -288,6 +292,8 @@ public class CleanRepositoryPage extends WizardPage { } catch (CoreException e) { // could not refresh... not a "real" problem } + + refreshRepositoriesView(); } }); } catch (Exception e) { @@ -295,4 +301,22 @@ public class CleanRepositoryPage extends WizardPage { } } + private void refreshRepositoriesView() { + UIJob job = new UIJob( + UIText.CleanRepositoryPage_RefreshingRepositories) { + + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + RepositoriesView view = (RepositoriesView) PlatformUI + .getWorkbench().getActiveWorkbenchWindow() + .getActivePage().findView(RepositoriesView.VIEW_ID); + if (view != null) { + view.refresh(); + } + return Status.OK_STATUS; + } + }; + job.schedule(); + } + } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties index 70682393f1..b83b37f103 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties @@ -286,6 +286,7 @@ CleanRepositoryPage_includeIgnored=Include ignored resources CleanRepositoryPage_message=Select items to clean CleanRepositoryPage_SelectFilesToClean=Select files to be deleted CleanRepositoryPage_title=Clean Repository +CleanRepositoryPage_RefreshingRepositories=Refreshing Repositories CleanWizard_title=Clean ''{0}'' ClearCredentialsCommand_clearingCredentialsFailed=Clearing credentials failed. CheckoutCommand_CheckoutLabel=Chec&k Out |