]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ImportDocumentWithDetail.java
Externalize strings in org.simantics.document.ui
[simantics/platform.git] / bundles / org.simantics.document.ui / src / org / simantics / document / ui / actions / ImportDocumentWithDetail.java
index 42a0a7c94fa8bd9476b069a73bf00698796fd8e9..be504594417a65b900c5172aeaade7d9da4cc686 100644 (file)
@@ -25,7 +25,6 @@ import org.simantics.document.AddDocumentAction;
 import org.simantics.document.FileDocumentUtil;
 import org.simantics.document.ui.dialogs.FileDetailDialog;
 import org.simantics.layer0.Layer0;
-import org.simantics.utils.datastructures.Callback;
 import org.simantics.utils.ui.ExceptionUtils;
 
 /**
@@ -72,15 +71,10 @@ public class ImportDocumentWithDetail extends AddDocumentAction {
                                            Resource newDoc = doDocumentImport(graph, resource, filename, name);
                                                dialog.getAnnotationConfigurator().apply(graph,newDoc);
                                        }
-                               },new Callback<DatabaseException>() {                           
-                                       @Override
-                                       public void run(DatabaseException parameter) {
-                                               dialog.getAnnotationConfigurator().dispose();
-                                               if (parameter != null) {
-                                                       ExceptionUtils.logAndShowError("Cannot import document.", parameter);
-                                               }
-                                               
-                                       }
+                               }, e -> {
+                                       dialog.getAnnotationConfigurator().dispose();
+                                       if (e != null)
+                                               ExceptionUtils.logAndShowError(Messages.ImportDocumentWithDetail_CannotImportDocument, e);
                                });
                        }
                };
@@ -97,8 +91,8 @@ public class ImportDocumentWithDetail extends AddDocumentAction {
        public static Resource importDocumentWithDetailSCL(WriteGraph graph, Resource target, String filename) throws FileNotFoundException, DatabaseException {
            File file = new File(filename);
            if (!file.exists())
-               throw new FileNotFoundException("File not found - " + file.getAbsolutePath());
-           ImportDocumentWithDetail document = new ImportDocumentWithDetail(graph, "http://www.simantics.org/Layer0-1.1/ConsistsOf");
+               throw new FileNotFoundException("File not found - " + file.getAbsolutePath()); //$NON-NLS-1$
+           ImportDocumentWithDetail document = new ImportDocumentWithDetail(graph, "http://www.simantics.org/Layer0-1.1/ConsistsOf"); //$NON-NLS-1$
            return document.doDocumentImport(graph, target, filename, file.getName());
        }