diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/application/RiseClipseValidatorSCLApplication.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/application/RiseClipseValidatorSCLApplication.java index b19b74f18162b6e6d8b7714a648a870572de1e37..a6e562f4b47bfb323a1720f7dd17377eaeaafcd4 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/application/RiseClipseValidatorSCLApplication.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/application/RiseClipseValidatorSCLApplication.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import javax.swing.JFrame; import javax.swing.JTabbedPane; -import fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui.component.OCLFilePane; +import fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui.component.TreeFilePane; import fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui.component.SCLFilePane; import javax.swing.JScrollPane; @@ -34,7 +34,8 @@ import javax.swing.JPanel; public class RiseClipseValidatorSCLApplication { private JFrame frame; - private OCLFilePane oclTree; + private TreeFilePane oclTree; + private TreeFilePane nsdTree; /** * Launch the application. @@ -78,16 +79,29 @@ public class RiseClipseValidatorSCLApplication { JScrollPane oclPane = new JScrollPane(); tabbedPane.addTab( "OCL Files", null, oclPane, null ); - File fileRoot = new File( System.getProperty( "user.dir" ) + "/OCL" ); - oclTree = new OCLFilePane( fileRoot ); + File oclRoot = new File( System.getProperty( "user.dir" ) + "/OCL" ); + oclTree = new TreeFilePane( oclRoot ); oclPane.setViewportView( oclTree ); + JScrollPane nsdPane = new JScrollPane(); + tabbedPane.addTab( "NSD Files", null, nsdPane, null ); + + File nsdRoot = new File( System.getProperty( "user.dir" ) + "/NSD" ); + nsdTree = new TreeFilePane( nsdRoot ); + nsdPane.setViewportView( nsdTree ); + } public ArrayList< File > getOclFiles() { ArrayList< File > oclFiles = new ArrayList<>(); - oclTree.getOclFiles( oclFiles ); + oclTree.getSelectedFiles( oclFiles ); return oclFiles; } + public ArrayList< File > getNsdFiles() { + ArrayList< File > nsdFiles = new ArrayList<>(); + nsdTree.getSelectedFiles( nsdFiles ); + return nsdFiles; + } + } diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SCLFilePane.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SCLFilePane.java index 6c03ee3cb223648ab63b78766439cca4781c48a7..82936d5b36dc3ff8311a26b8a0342929c7278c65 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SCLFilePane.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SCLFilePane.java @@ -87,6 +87,13 @@ public class SCLFilePane extends JPanel implements ActionListener { .map( f -> f.getAbsolutePath() ) .collect( Collectors.toList() ); + ArrayList< File > nsdFiles = application.getNsdFiles(); + List< String > nsdFileNames = + nsdFiles + .stream() + .map( f -> f.getAbsolutePath() ) + .collect( Collectors.toList() ); + ArrayList< String > sclFiles = sclFilesList.getSclFiles(); ResultFrame result = new ResultFrame(); @@ -94,7 +101,7 @@ public class SCLFilePane extends JPanel implements ActionListener { IRiseClipseConsole console = result.getMainConsole(); AbstractRiseClipseConsole.changeConsole( console ); RiseClipseValidatorSCL.displayLegal( ); - RiseClipseValidatorSCL.prepare( oclFileNames, null, false ); + RiseClipseValidatorSCL.prepare( oclFileNames, nsdFileNames, false ); result.repaint(); for( int i = 0; i < sclFiles.size(); ++i ) { console = result.getConsoleFor( sclFiles.get( i )); diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/OCLFilePane.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java similarity index 91% rename from fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/OCLFilePane.java rename to fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java index ca0c74de21727ba6f376231a186a116e727f215f..d5e5bf4ee2d854d29f0651d175a34cb5214d4b38 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/OCLFilePane.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java @@ -32,11 +32,11 @@ import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreePath; @SuppressWarnings( "serial" ) -public class OCLFilePane extends JTree { +public class TreeFilePane extends JTree { private DefaultMutableTreeNode root; - public OCLFilePane( File fileRoot ) { + public TreeFilePane( File fileRoot ) { root = new DefaultMutableTreeNode( new SclFileCheckBox( fileRoot ) ); setModel( new DefaultTreeModel( root ) ); setShowsRootHandles( true ); @@ -98,11 +98,11 @@ public class OCLFilePane extends JTree { } } - public void getOclFiles( ArrayList< File > oclFiles ) { - getOclFiles( root, oclFiles ); + public void getSelectedFiles( ArrayList< File > oclFiles ) { + getSelectedFiles( root, oclFiles ); } - private void getOclFiles( DefaultMutableTreeNode node, ArrayList< File > oclFiles ) { + private void getSelectedFiles( DefaultMutableTreeNode node, ArrayList< File > oclFiles ) { SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); if( checkbox.getFile().isFile() ) { if( checkbox.getCheckBox().isSelected() ) { @@ -111,7 +111,7 @@ public class OCLFilePane extends JTree { } else { for( int i = 0; i < node.getChildCount(); ++i ) { - getOclFiles( ( DefaultMutableTreeNode ) node.getChildAt( i ), oclFiles ); + getSelectedFiles( ( DefaultMutableTreeNode ) node.getChildAt( i ), oclFiles ); } } }