Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java

Issue 9664033: Undo support for resource actions in the Files View. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java (revision 5277)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java (working copy)
@@ -26,6 +26,7 @@
import com.google.dart.tools.ui.internal.projects.HideProjectAction;
import com.google.dart.tools.ui.internal.util.SWTUtil;
+import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -58,6 +59,7 @@
import org.eclipse.ui.actions.RenameResourceAction;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.operations.UndoRedoActionGroup;
import org.eclipse.ui.part.ISetSelectionTarget;
import org.eclipse.ui.part.ViewPart;
@@ -129,6 +131,8 @@
private HideProjectAction hideContainerAction;
+ private UndoRedoActionGroup undoRedoActionGroup;
+
private IPropertyChangeListener fontPropertyChangeListener = new FontPropertyChangeListener();
public FilesView() {
@@ -155,6 +159,7 @@
getSite().setSelectionProvider(treeViewer);
fillInToolbar(getViewSite().getActionBars().getToolBarManager());
+ fillInActionBars();
// Create the TreeViewer's context menu.
createContextMenu();
@@ -195,6 +200,9 @@
if (linkWithEditorAction != null) {
linkWithEditorAction.dispose();
}
+ if (undoRedoActionGroup != null) {
+ undoRedoActionGroup.dispose();
+ }
treeViewer.removeSelectionChangedListener(copyFilePathAction);
@@ -331,6 +339,13 @@
treeViewer.getTree().setFont(font);
}
+ private void fillInActionBars() {
+ IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(
+ IUndoContext.class);
+ undoRedoActionGroup = new UndoRedoActionGroup(getViewSite(), workspaceContext, true);
+ undoRedoActionGroup.fillActionBars(getViewSite().getActionBars());
+ }
+
private Shell getShell() {
return getSite().getShell();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698