Bug 13349 fixed: Double-clicking on a mat file did not load it 05/14505/3
Calixte DENIZET [Mon, 5 May 2014 13:19:36 +0000 (15:19 +0200)]
Change-Id: I1ec826494e9f265c0dd23ae2ffc832f387a5ff56

scilab/CHANGES_5.5.X
scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/images/icons/16x16/mimetypes/application-mat.png [new file with mode: 0644]
scilab/modules/javasci/Makefile.in
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/FileUtils.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/SwingScilabTreeTable.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/actions/ExecuteMatFileAction.java [new file with mode: 0644]
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/actions/ValidateAction.java

index 775d964..68ecca6 100644 (file)
@@ -37,6 +37,8 @@ Scilab Bug Fixes
 
 * Bug #13344 fixed - User defined ticks were not drawn at the right position.
 
+* Bug #13349 fixed - Double-clicking on a MAT-file in file browser did not load it.
+
 * Bug #13378 fixed - The "Console" handle display was not homogeneous with others.
 
 * Bug #13381 fixed - eigs was failing when using a function as first input argument.
@@ -66,6 +68,7 @@ Scilab Bug Fixes
                      now permute treats extra dimensions as 1
 
 
+
 Xcos Bug Fixes
 ==============
 
index e7ff44d..92946a0 100755 (executable)
@@ -365,6 +365,7 @@ images/icons/16x16/mimetypes/text-csv.png \
 images/icons/16x16/mimetypes/text-html.png \
 images/icons/16x16/mimetypes/text-x-generic.png \
 images/icons/16x16/mimetypes/text-xml.png \
+images/icons/16x16/mimetypes/application-mat.png \
 images/icons/16x16/places/folder.png \
 images/icons/16x16/places/folder-saved-search.png \
 images/icons/16x16/places/scilab-folder.png \
index 2d33209..840179d 100644 (file)
@@ -1027,6 +1027,7 @@ images/icons/16x16/mimetypes/text-csv.png \
 images/icons/16x16/mimetypes/text-html.png \
 images/icons/16x16/mimetypes/text-x-generic.png \
 images/icons/16x16/mimetypes/text-xml.png \
+images/icons/16x16/mimetypes/application-mat.png \
 images/icons/16x16/places/folder.png \
 images/icons/16x16/places/folder-saved-search.png \
 images/icons/16x16/places/scilab-folder.png \
diff --git a/scilab/modules/gui/images/icons/16x16/mimetypes/application-mat.png b/scilab/modules/gui/images/icons/16x16/mimetypes/application-mat.png
new file mode 100644 (file)
index 0000000..4cfd9ef
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/mimetypes/application-mat.png differ
index be8b26b..9c784fa 100644 (file)
@@ -976,10 +976,10 @@ maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-@JAVASCI_FALSE@install-html-local:
-@JAVASCI_FALSE@clean-local:
 @JAVASCI_FALSE@distclean-local:
 @JAVASCI_FALSE@install-data-local:
+@JAVASCI_FALSE@clean-local:
+@JAVASCI_FALSE@install-html-local:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool clean-local \
index a0da0ef..fc1ca0b 100644 (file)
@@ -47,6 +47,7 @@ public final class FileUtils {
     private static final Icon UPICON = new ImageIcon(FindIconHelper.findIcon("dynamic-blue-up"));
     private static final Icon SCIICON = new ImageIcon(FindIconHelper.findIcon("scilab-folder"));
     private static final Icon OPENSCIICON = new ImageIcon(FindIconHelper.findIcon("scilab-folder-open"));
+    private static final Icon MATICON = new ImageIcon(FindIconHelper.findIcon("application-mat"));
 
     private static final int CHARTOREAD = 128;
 
@@ -75,6 +76,7 @@ public final class FileUtils {
         extToIcon.put("htm", HTMLICON);
         extToIcon.put("xml", XMLICON);
         extToIcon.put("csv", CSVICON);
+        extToIcon.put("mat", MATICON);
     }
 
     /**
index 2592b1e..bd7bc15 100644 (file)
@@ -52,6 +52,7 @@ import org.scilab.modules.ui_data.filebrowser.actions.ChangeCWDAction;
 import org.scilab.modules.ui_data.filebrowser.actions.EditFileWithDefaultAppAction;
 import org.scilab.modules.ui_data.filebrowser.actions.ExecuteFileInConsoleAction;
 import org.scilab.modules.ui_data.filebrowser.actions.ExecuteFileInXcosAction;
+import org.scilab.modules.ui_data.filebrowser.actions.ExecuteMatFileAction;
 import org.scilab.modules.ui_data.filebrowser.actions.LoadFileAsGraphAction;
 import org.scilab.modules.ui_data.filebrowser.actions.LoadFileInScilabAction;
 import org.scilab.modules.ui_data.filebrowser.actions.OpenFileInSciNotesAction;
@@ -359,6 +360,7 @@ public class SwingScilabTreeTable extends JTable {
         final ActionMap actions = getActionMap();
         actions.put("scinotes", new OpenFileInSciNotesAction(this));
         actions.put("xcos", new ExecuteFileInXcosAction(this));
+        actions.put("mat", new ExecuteMatFileAction(this));
         actions.put("console", new ExecuteFileInConsoleAction(this));
         actions.put("load", new LoadFileInScilabAction(this));
         actions.put("graph", new LoadFileAsGraphAction(this));
diff --git a/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/actions/ExecuteMatFileAction.java b/scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/filebrowser/actions/ExecuteMatFileAction.java
new file mode 100644 (file)
index 0000000..11c7b00
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+package org.scilab.modules.ui_data.filebrowser.actions;
+
+import org.scilab.modules.ui_data.filebrowser.SwingScilabTreeTable;
+
+/**
+ * Action to load the mat file
+ * @author Calixte DENIZET
+ */
+@SuppressWarnings(value = { "serial" })
+public class ExecuteMatFileAction extends ExecuteCommandAction {
+
+    private static final String MAT = "loadmatfile('%s')";
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExecuteMatFileAction(SwingScilabTreeTable table) {
+        super(table, MAT);
+    }
+}
index 7a88555..f9114b1 100644 (file)
@@ -55,6 +55,7 @@ public class ValidateAction extends CommonCallBack {
         ext.put("sav", actions.get("load"));
         ext.put("sod", actions.get("load"));
         ext.put("graph", actions.get("graph"));
+        ext.put("mat", actions.get("mat"));
     }
 
     /**