Revision 32633 branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/panel/PluginsTablePanel.java
PluginsTablePanel.java | ||
---|---|---|
43 | 43 |
import org.gvsig.installer.lib.api.PackageInfo; |
44 | 44 |
import org.gvsig.installer.swing.api.SwingInstallerLocator; |
45 | 45 |
import org.gvsig.installer.swing.impl.DefaultSwingInstallerManager; |
46 |
import org.gvsig.installer.swing.impl.execution.model.PluginsTableCellRenderer;
|
|
47 |
import org.gvsig.installer.swing.impl.execution.model.PluginsTableModel;
|
|
46 |
import org.gvsig.installer.swing.impl.execution.model.PackagesTableCellRenderer;
|
|
47 |
import org.gvsig.installer.swing.impl.execution.model.PackagesTableModel;
|
|
48 | 48 |
|
49 | 49 |
/** |
50 | 50 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
... | ... | |
56 | 56 |
private JScrollPane pluginsScrollPane; |
57 | 57 |
private JTable pluginsTable; |
58 | 58 |
|
59 |
public PluginsTablePanel() { |
|
59 |
public PluginsTablePanel(SelectPluginsPanel selectPluginsPanel) {
|
|
60 | 60 |
super(); |
61 | 61 |
swingInstallerManager = (DefaultSwingInstallerManager)SwingInstallerLocator.getSwingInstallerManager(); |
62 | 62 |
initComponents(); |
63 | 63 |
pluginsTable.getSelectionModel().addListSelectionListener(this); |
64 |
pluginsTable.setDefaultRenderer(Boolean.class, new PluginsTableCellRenderer());
|
|
64 |
pluginsTable.setDefaultRenderer(Boolean.class, new PackagesTableCellRenderer(selectPluginsPanel));
|
|
65 | 65 |
pluginsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); |
66 | 66 |
} |
67 | 67 |
|
68 |
public void setTableModel(PluginsTableModel pluginsTableModel){
|
|
68 |
public void setTableModel(PackagesTableModel pluginsTableModel){
|
|
69 | 69 |
pluginsTable.setModel(pluginsTableModel); |
70 | 70 |
TableColumnModel tableColumnModel = pluginsTable.getColumnModel(); |
71 | 71 |
tableColumnModel.getColumn(0).setPreferredWidth(25); |
... | ... | |
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
|
80 |
public void addInstallersToExecute(List<PackageInfo> installerInfosToInstall){ |
|
81 |
((PluginsTableModel)pluginsTable.getModel()).addInstallersToExecute(installerInfosToInstall); |
|
80 |
public void addPackageInfosToInstall(List<PackageInfo> packageInfosToInstall){ |
|
81 |
((PackagesTableModel)pluginsTable.getModel()).addPackageInfosToInstall(packageInfosToInstall); |
|
82 |
} |
|
83 |
|
|
84 |
public boolean isPackageSelected(){ |
|
85 |
return ((PackagesTableModel)pluginsTable.getModel()).isPackageSelected(); |
|
82 | 86 |
} |
83 | 87 |
|
84 | 88 |
private void initComponents() { |
... | ... | |
118 | 122 |
public void valueChanged(ListSelectionEvent e) { |
119 | 123 |
int row = pluginsTable.getSelectedRow(); |
120 | 124 |
if (row != -1){ |
121 |
descriptionTextArea.setText(((PluginsTableModel)pluginsTable.getModel()).getDescriptionAt(row)); |
|
122 |
} |
|
123 |
|
|
124 |
} |
|
125 |
descriptionTextArea.setText(((PackagesTableModel)pluginsTable.getModel()).getDescriptionAt(row)); |
|
126 |
} |
|
127 |
} |
|
125 | 128 |
} |
126 | 129 |
|
Also available in: Unified diff