| 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 16570)
|
| +++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/filesview/FilesView.java (working copy)
|
| @@ -16,6 +16,8 @@
|
| import com.google.dart.tools.core.DartCore;
|
| import com.google.dart.tools.core.internal.model.DartModelManager;
|
| import com.google.dart.tools.core.model.DartIgnoreListener;
|
| +import com.google.dart.tools.core.pub.IPubUpdateListener;
|
| +import com.google.dart.tools.core.pub.PubManager;
|
| import com.google.dart.tools.ui.DartToolsPlugin;
|
| import com.google.dart.tools.ui.ProblemsLabelDecorator;
|
| import com.google.dart.tools.ui.actions.CopyFilePathAction;
|
| @@ -66,6 +68,7 @@
|
| import org.eclipse.swt.dnd.Transfer;
|
| import org.eclipse.swt.graphics.Font;
|
| import org.eclipse.swt.widgets.Composite;
|
| +import org.eclipse.swt.widgets.Display;
|
| import org.eclipse.swt.widgets.Event;
|
| import org.eclipse.swt.widgets.Listener;
|
| import org.eclipse.swt.widgets.Menu;
|
| @@ -124,6 +127,23 @@
|
|
|
| }
|
|
|
| + private class PubUpdateListener implements IPubUpdateListener {
|
| + @Override
|
| + public void packagesUpdated(final IContainer container) {
|
| + Display.getDefault().asyncExec(new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + if (treeViewer != null) {
|
| + IResource resource = container.findMember(DartCore.PACKAGES_DIRECTORY_NAME);
|
| + if (resource != null) {
|
| + treeViewer.refresh(resource);
|
| + }
|
| + }
|
| + }
|
| + });
|
| + }
|
| + }
|
| +
|
| public static final String VIEW_ID = "com.google.dart.tools.ui.FileExplorer"; // from plugin.xml
|
|
|
| /**
|
| @@ -190,6 +210,8 @@
|
| }
|
| };
|
|
|
| + private IPubUpdateListener pubUpdateListener = new PubUpdateListener();
|
| +
|
| private RefreshAction refreshAction;
|
|
|
| private CopyAction copyAction;
|
| @@ -256,6 +278,7 @@
|
| updateTreeFont();
|
| getPreferences().addPropertyChangeListener(propertyChangeListener);
|
| updateColors();
|
| + PubManager.getInstance().addListener(pubUpdateListener);
|
|
|
| restoreState();
|
| }
|
| @@ -291,6 +314,9 @@
|
| treeViewer.removeSelectionChangedListener(propertyDialogAction);
|
| }
|
|
|
| + if (pubUpdateListener != null) {
|
| + PubManager.getInstance().removeListener(pubUpdateListener);
|
| + }
|
| super.dispose();
|
| }
|
|
|
|
|