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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/handlers/OpenFileHandler.java

Issue 8395010: fix for opening a file that does not belong to a library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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/handlers/OpenFileHandler.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/handlers/OpenFileHandler.java (revision 703)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/handlers/OpenFileHandler.java (working copy)
@@ -20,7 +20,7 @@
import com.google.dart.tools.core.model.DartModelException;
import com.google.dart.tools.ui.DartToolsPlugin;
import com.google.dart.tools.ui.DartUI;
-import com.google.dart.tools.ui.actions.ActionMessages;
+import com.google.dart.tools.ui.Messages;
import com.google.dart.tools.ui.internal.actions.WorkbenchRunnableAdapter;
import com.google.dart.tools.ui.internal.text.editor.EditorUtility;
import com.google.dart.tools.ui.internal.util.ExceptionHandler;
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
@@ -99,8 +100,8 @@
})); // workspace lock
} catch (InvocationTargetException e) {
- ExceptionHandler.handle(e, shell, ActionMessages.FormatAllAction_error_title,
- ActionMessages.FormatAllAction_error_message);
+ ExceptionHandler.handle(e, shell, HandlerMessages.OpenFile_label,
+ HandlerMessages.OpenFile_errorMessage);
} catch (InterruptedException e) {
// canceled by user
}
@@ -108,6 +109,9 @@
try {
if (files[0] != null) {
EditorUtility.openInEditor(files[0], true);
+ } else if (libFile[0] == null) {
+ MessageDialog.openError(shell, HandlerMessages.OpenFile_label,
+ Messages.format(HandlerMessages.OpenFile_errorFileNotInLibrary, selectedFile.getName()));
}
} catch (PartInitException e) {
throwFailedToOpen(selectedFile, e);
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/handlers/HandlerMessages.properties ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698