diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java similarity index 93% rename from fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java rename to fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java index dc3884dfd294824f81f29514f80ec9f6c6bedc58..b0c8ee9a0585dbf22f866507577711ee8423102b 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileCheckBox.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/FileCheckBox.java @@ -22,12 +22,12 @@ import java.io.File; import javax.swing.JCheckBox; -public class SclFileCheckBox { +public class FileCheckBox { private File file; private JCheckBox checkBox; - public SclFileCheckBox( File file ) { + public FileCheckBox( File file ) { this.file = file; this.checkBox = new JCheckBox( file.getName() ); this.checkBox.setSelected( true ); diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java index f19f41497d3fd4073cc4c149f4dafbd42a2552ee..594552ed0b34b32be94ea021f64b79d49344f229 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/SclFileList.java @@ -37,14 +37,14 @@ import javax.swing.border.EmptyBorder; * Adapted from http://www.devx.com/tips/Tip/5342 */ @SuppressWarnings( "serial" ) -public class SclFileList extends JList< SclFileCheckBox > { +public class SclFileList extends JList< FileCheckBox > { protected static Border noFocusBorder = new EmptyBorder( 1, 1, 1, 1 ); - private DefaultListModel< SclFileCheckBox > model; + private DefaultListModel< FileCheckBox > model; public SclFileList() { - model = new DefaultListModel< SclFileCheckBox >(); + model = new DefaultListModel< FileCheckBox >(); setModel( model ); setCellRenderer( new SclFileCellRenderer() ); @@ -71,14 +71,14 @@ public class SclFileList extends JList< SclFileCheckBox > { } } - SclFileCheckBox check = new SclFileCheckBox( file ); + FileCheckBox check = new FileCheckBox( file ); model.addElement( check ); } - protected class SclFileCellRenderer implements ListCellRenderer< SclFileCheckBox > { + protected class SclFileCellRenderer implements ListCellRenderer< FileCheckBox > { @Override - public Component getListCellRendererComponent( JList< ? extends SclFileCheckBox > list, SclFileCheckBox file, int index, + public Component getListCellRendererComponent( JList< ? extends FileCheckBox > list, FileCheckBox file, int index, boolean isSelected, boolean cellHasFocus ) { JCheckBox checkbox = file.getCheckBox(); checkbox.setBackground( isSelected ? getSelectionBackground() : getBackground() ); diff --git a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java index d5e5bf4ee2d854d29f0651d175a34cb5214d4b38..3bae483b5a85caa1554ddd4126a5bf53ed0ed98e 100644 --- a/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java +++ b/fr.centralesupelec.edf.riseclipse.iec61850.scl.validator.ui/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/ui/component/TreeFilePane.java @@ -37,7 +37,7 @@ public class TreeFilePane extends JTree { private DefaultMutableTreeNode root; public TreeFilePane( File fileRoot ) { - root = new DefaultMutableTreeNode( new SclFileCheckBox( fileRoot ) ); + root = new DefaultMutableTreeNode( new FileCheckBox( fileRoot ) ); setModel( new DefaultTreeModel( root ) ); setShowsRootHandles( true ); @@ -52,14 +52,14 @@ public class TreeFilePane extends JTree { if( selRow != -1 ) { TreePath selPath = getPathForLocation( e.getX(), e.getY() ); DefaultMutableTreeNode node = (( DefaultMutableTreeNode ) selPath.getLastPathComponent() ); - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); propagateInTree( node, ! checkbox.getCheckBox().isSelected() ); repaint(); } } private void propagateInTree( DefaultMutableTreeNode node, boolean selected ) { - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); checkbox.getCheckBox().setSelected( selected ); for( int i = 0; i < node.getChildCount(); ++i ) { propagateInTree( ( DefaultMutableTreeNode ) node.getChildAt( i ), selected ); @@ -74,7 +74,7 @@ public class TreeFilePane extends JTree { if( files == null ) return; for( File file : files ) { - DefaultMutableTreeNode childNode = new DefaultMutableTreeNode( new SclFileCheckBox( file ) ); + DefaultMutableTreeNode childNode = new DefaultMutableTreeNode( new FileCheckBox( file ) ); node.add( childNode ); if( file.isDirectory() ) { createChildren( file, childNode ); @@ -88,7 +88,7 @@ public class TreeFilePane extends JTree { public Component getTreeCellRendererComponent( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus ) { DefaultMutableTreeNode node = ( DefaultMutableTreeNode ) value; - SclFileCheckBox file = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox file = ( FileCheckBox ) node.getUserObject(); JCheckBox checkbox = file.getCheckBox(); checkbox.setEnabled( isEnabled() ); checkbox.setFont( getFont() ); @@ -103,7 +103,7 @@ public class TreeFilePane extends JTree { } private void getSelectedFiles( DefaultMutableTreeNode node, ArrayList< File > oclFiles ) { - SclFileCheckBox checkbox = ( SclFileCheckBox ) node.getUserObject(); + FileCheckBox checkbox = ( FileCheckBox ) node.getUserObject(); if( checkbox.getFile().isFile() ) { if( checkbox.getCheckBox().isSelected() ) { oclFiles.add( checkbox.getFile() );