01: /*
02: * Copyright (C) 2001, 2002 Robert MacGrogan
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: *
19: * $Archive: SourceJammer$
20: * $FileName: RebuildFileViewProcess.java$
21: * $FileID: 4142$
22: *
23: * Last change:
24: * $AuthorName: Rob MacGrogan$
25: * $Date: 4/23/03 5:11 PM$
26: * $Comment: Replaced GPL header with LGPL header.$
27: */
28:
29: package org.sourcejammer.client.gui.process;
30:
31: import java.awt.Cursor;
32:
33: import javax.swing.JTable;
34:
35: import org.sourcejammer.client.gui.CommandCentral;
36:
37: /**
38: * Title: $FileName: RebuildFileViewProcess.java$
39: * @version $VerNum: 2$
40: * @author $AuthorName: Rob MacGrogan$<br><br>
41: *
42: * $Description: $<br>
43: * $KeyWordsOff: $<br>
44: */
45: public class RebuildFileViewProcess extends AbstractProcess {
46:
47: /**
48: * @see org.sourcejammer.client.gui.process.AbstractProcess#process(Object)
49: */
50: public void process(Object info) {
51: try {
52: //First let's get all selected row numbers.
53: CommandCentral central = CommandCentral.getInstance();
54: JTable table = central.getRootAppFrame().getPrimaryTable();
55: int iSelectedRows[] = table.getSelectedRows();
56:
57: //Rebuild the view.
58: central.getInstance().rebuildFileView(true);
59:
60: //Above command changed the table, so . . .
61: table = central.getRootAppFrame().getPrimaryTable();
62: //Now re-select the rows.
63: for (int i = 0; i < iSelectedRows.length; i++) {
64: if (iSelectedRows[i] < table.getRowCount())
65: table.addRowSelectionInterval(iSelectedRows[i],
66: iSelectedRows[i]);
67: }
68: } catch (Exception ex) {
69: ex.printStackTrace();
70: //central.displayErrorMessage(ex.getMessage());
71: } finally {
72: //CommandCentral.getInstance().getRootAppFrame().setCursor(Cursor.getDefaultCursor());
73: }
74: }
75:
76: }
|