From: <dal...@us...> - 2007-12-23 04:31:08
|
Revision: 11443 http://jedit.svn.sourceforge.net/jedit/?rev=11443&view=rev Author: daleanson Date: 2007-12-22 20:31:07 -0800 (Sat, 22 Dec 2007) Log Message: ----------- More work on copy, which pointed out a few issues with Delete and Add. Modified Paths: -------------- plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/CopyAction.java plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/DeleteAction.java plugins/SVNPlugin/trunk/src/ise/plugin/svn/command/Copy.java plugins/SVNPlugin/trunk/src/ise/plugin/svn/gui/AddDialog.java Modified: plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/CopyAction.java =================================================================== --- plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/CopyAction.java 2007-12-23 04:30:04 UTC (rev 11442) +++ plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/CopyAction.java 2007-12-23 04:31:07 UTC (rev 11443) @@ -233,8 +233,8 @@ return ; } TreeMap<String, SVNCommitInfo> results = get(); - System.out.println( "+++++ results = " + results ); - System.out.println( "+++++ where2where = " + where2where ); + //System.out.println( "+++++ results = " + results ); + //System.out.println( "+++++ where2where = " + where2where ); switch ( where2where ) { case W2W: case U2W: { @@ -270,7 +270,7 @@ default: // this shouldn't happen, so I'll just quietly // ignore this case - System.out.println( "+++++ the thing that can't happen did" ); + //System.out.println( "+++++ the thing that can't happen did" ); } } catch ( Exception e ) { Modified: plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/DeleteAction.java =================================================================== --- plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/DeleteAction.java 2007-12-23 04:30:04 UTC (rev 11442) +++ plugins/SVNPlugin/trunk/src/ise/plugin/svn/action/DeleteAction.java 2007-12-23 04:31:07 UTC (rev 11443) @@ -66,7 +66,7 @@ /** * @param view the View in which to display results - * @param paths a list of paths to be added + * @param paths a list of paths to be deleted * @param username the username for the svn repository * @param password the password for the username */ Modified: plugins/SVNPlugin/trunk/src/ise/plugin/svn/command/Copy.java =================================================================== --- plugins/SVNPlugin/trunk/src/ise/plugin/svn/command/Copy.java 2007-12-23 04:30:04 UTC (rev 11442) +++ plugins/SVNPlugin/trunk/src/ise/plugin/svn/command/Copy.java 2007-12-23 04:31:07 UTC (rev 11443) @@ -85,10 +85,6 @@ SVNURL sourceURL = data.getSourceURL(); SVNURL destinationURL = data.getDestinationURL(); SVNCommitInfo results = SVNCommitInfo.NULL; - System.out.println("+++++ sourceFile = " + sourceFile); - System.out.println("+++++ destinationFile = " + destinationFile); - System.out.println("+++++ sourceURL = " + sourceURL); - System.out.println("+++++ destinationURL = " + destinationURL); if (sourceFile != null && destinationFile != null) { // copy working copy to working copy, this is a local copy or move Modified: plugins/SVNPlugin/trunk/src/ise/plugin/svn/gui/AddDialog.java =================================================================== --- plugins/SVNPlugin/trunk/src/ise/plugin/svn/gui/AddDialog.java 2007-12-23 04:30:04 UTC (rev 11442) +++ plugins/SVNPlugin/trunk/src/ise/plugin/svn/gui/AddDialog.java 2007-12-23 04:31:07 UTC (rev 11443) @@ -36,6 +36,7 @@ import java.io.File; import java.util.*; import javax.swing.*; +import javax.swing.table.*; import javax.swing.border.EmptyBorder; import org.gjt.sp.jedit.GUIUtilities; import org.gjt.sp.jedit.jEdit; @@ -46,6 +47,7 @@ import projectviewer.ProjectViewer; import projectviewer.config.ProjectOptions; import ise.java.awt.KappaLayout; +import ise.java.awt.LambdaLayout; import ise.plugin.svn.data.SVNData; import ise.plugin.svn.library.PasswordHandler; import ise.plugin.svn.library.PasswordHandlerException; @@ -99,15 +101,35 @@ addData.setRecursive(recursive); JLabel file_label = new JLabel("Adding these files:"); - final JPanel file_panel = new JPanel(new GridLayout(0, 1, 2, 3)); - file_panel.setBackground(Color.WHITE); - file_panel.setBorder(new EmptyBorder(3, 3, 3, 3)); - for(String path : paths) { - JCheckBox cb = new JCheckBox(path); - cb.setSelected(true); - cb.setBackground(Color.WHITE); - file_panel.add(cb); + JTable file_table = new JTable(); + //file_table.setFillsViewportHeight(true); // java 1.6 + final DefaultTableModel file_table_model = new DefaultTableModel( + new String[] { + "", "File" + }, paths.size() ) { + public Class getColumnClass( int index ) { + if ( index == 0 ) { + return Boolean.class; + } + else { + return super.getColumnClass( index ); + } + + } + }; + file_table.setModel( file_table_model ); + + // load the table model + int i = 0; + for ( String path : paths ) { + if (path != null) { + file_table_model.setValueAt( true, i, 0 ); + file_table_model.setValueAt( path, i, 1 ); + ++i; + } } + file_table.getColumnModel().getColumn(0).setMaxWidth(25); + file_table.getColumnModel().getColumn(1).setPreferredWidth(575); final JCheckBox recursive_cb = new JCheckBox("Recursively add?"); recursive_cb.setSelected(recursive); @@ -130,20 +152,21 @@ public void actionPerformed( ActionEvent ae ) { // get the paths List<String> paths = new ArrayList<String>(); - Component[] files = file_panel.getComponents(); - for (Component file : files) { - JCheckBox cb = (JCheckBox)file; - if (cb.isSelected()) { - paths.add(cb.getText()); + for (int row = 0; row < file_table_model.getRowCount(); row++) { + Boolean selected = (Boolean)file_table_model.getValueAt(row, 0); + if (selected) { + paths.add((String)file_table_model.getValueAt(row, 1)); } } + if (paths.size() == 0) { - // nothing to commit, bail out + // nothing to add, bail out addData = null; } else { addData.setPaths(paths); } + AddDialog.this.setVisible( false ); AddDialog.this.dispose(); } @@ -161,7 +184,7 @@ // add the components to the option panel panel.add( "0, 0, 1, 1, W, , 3", file_label ); - panel.add( "0, 1, 1, 1, W, wh, 3", new JScrollPane( file_panel ) ); + panel.add( "0, 1, 1, 1, W, wh, 3", new JScrollPane( file_table ) ); panel.add( "1, 1, 1, 1, 0, , 0", KappaLayout.createVerticalStrut( 120, true)); panel.add( "0, 2, 1, 1, 0, , 0", KappaLayout.createVerticalStrut( 6, true ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |