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

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

Issue 9704021: Add a top-level node in the Files view to display the SDK libraries. (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
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 5473)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java (working copy)
@@ -77,17 +77,6 @@
/**
* File-oriented view for navigating Dart projects.
- * <p>
- * This view will replace the current "Libraries" view once a few tasks are completed:
- * <p>
- * TODO Remove the deprecated CreateFileAction and CreateFolderActions with new Dart Editor specific
- * versions
- * <p>
- * TODO modify the builder to ensure that the correct libraries are built when the user makes
- * changes to Dart code
- * <p>
- * TODO re-visit the DeltaProcessor and ensure that all user actions result in a correct update of
- * the model in the viewer
*/
@SuppressWarnings("deprecation")
public class FilesView extends ViewPart implements ISetSelectionTarget {
@@ -158,9 +147,8 @@
public void createPartControl(Composite parent) {
treeViewer = new TreeViewer(parent);
treeViewer.setContentProvider(new ResourceContentProvider());
- //TODO (pquitslund): replace with WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()
- // when we have the linked resource story straightened out
-// treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
+ // TODO(pquitslund): replace with WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()
+ //treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
treeViewer.setLabelProvider(new DecoratingLabelProvider(new WorkbenchLabelProvider(),
new ProblemsLabelDecorator()));
treeViewer.setComparator(new FilesViewerComparator());
@@ -262,7 +250,6 @@
}
}
}
-
}
@Override
@@ -290,19 +277,23 @@
}
protected void fillContextMenu(IMenuManager manager) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
// New File/ New Folder
- manager.add(createFileAction);
- manager.add(createFolderAction);
+ if (allElementsAreResources(selection)) {
+ manager.add(createFileAction);
+ manager.add(createFolderAction);
+ }
// OPEN GROUP
- manager.add(new Separator());
+ if (manager.getItems().length > 0) {
+ manager.add(new Separator());
+ }
+
manager.add(OpenFolderHandler.createCommandAction(getSite().getWorkbenchWindow()));
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
-
// REFACTOR GROUP
// Refactor iff all elements are IResources
@@ -332,11 +323,9 @@
manager.add(hideContainerAction);
}
}
-
}
protected void fillInToolbar(IToolBarManager toolbar) {
-
// Link with Editor
linkWithEditorAction = new LinkWithEditorAction(getViewSite().getPage(), treeViewer);

Powered by Google App Engine
This is Rietveld 408576698