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

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

Issue 10911221: show category information for sdk libs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/DartDirectoryNode.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/DartDirectoryNode.java (revision 12204)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/DartDirectoryNode.java (working copy)
@@ -20,6 +20,7 @@
import com.google.dart.tools.ui.DartToolsPlugin;
import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import java.io.File;
@@ -72,11 +73,23 @@
for (SystemLibrary systemLibrary : systemLibraries) {
if (systemLibrary.isDocumented()) {
file = systemLibrary.getLibraryDir();
- libs.add(
- new DartLibraryNode(
- this,
- EFS.getLocalFileSystem().fromLocalFile(file),
- systemLibrary.getShortName()));
+ String pathToLib = systemLibrary.getPathToLib();
+ if (pathToLib.indexOf("/") != -1) {
+ file = new File(file, new Path(pathToLib).removeLastSegments(1).toOSString());
+ }
+ if (!systemLibrary.isShared()) {
+ libs.add(new DartLibraryNode(
+ this,
+ EFS.getLocalFileSystem().fromLocalFile(file),
+ systemLibrary.getShortName(),
+ systemLibrary.getCategory().toLowerCase()));
+ } else {
+ libs.add(new DartLibraryNode(
+ this,
+ EFS.getLocalFileSystem().fromLocalFile(file),
+ systemLibrary.getShortName()));
+ }
+
}
}
@@ -86,11 +99,10 @@
if (file != null) {
for (File child : file.listFiles()) {
if (child.isDirectory()) {
- libs.add(
- new DartLibraryNode(
- this,
- EFS.getLocalFileSystem().fromLocalFile(child),
- child.getName()));
+ libs.add(new DartLibraryNode(
+ this,
+ EFS.getLocalFileSystem().fromLocalFile(child),
+ child.getName()));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698