Revision 41691 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/panel/SelectPluginToInstallPanel.java
SelectPluginToInstallPanel.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
package org.gvsig.installer.swing.impl.creation.panel; |
30 | 30 |
|
31 |
import java.awt.GridBagConstraints; |
|
32 |
import java.awt.GridBagLayout; |
|
31 |
import java.awt.BorderLayout; |
|
32 |
import java.awt.Checkbox; |
|
33 |
import java.awt.event.ActionEvent; |
|
34 |
import java.awt.event.ActionListener; |
|
35 |
import javax.swing.JCheckBox; |
|
33 | 36 |
|
34 | 37 |
import javax.swing.JList; |
35 | 38 |
import javax.swing.JPanel; |
36 | 39 |
import javax.swing.JScrollPane; |
40 |
import javax.swing.SwingConstants; |
|
37 | 41 |
|
38 | 42 |
import org.gvsig.installer.lib.api.PackageInfo; |
39 | 43 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageService; |
... | ... | |
56 | 60 |
private JList pluginList; |
57 | 61 |
private JScrollPane pluginScrollPane1; |
58 | 62 |
private PackageInfo selectedInstallerInfo = null; |
63 |
private JCheckBox chkShowFullPath; |
|
64 |
private PluginListModel pluginListModel; |
|
59 | 65 |
|
60 | 66 |
public SelectPluginToInstallPanel() { |
61 | 67 |
super(); |
... | ... | |
67 | 73 |
public void setPluginsDirectory( |
68 | 74 |
MakePluginPackageService installerCreationService) |
69 | 75 |
throws MakePluginPackageServiceException { |
70 |
pluginList.setModel(new PluginListModel(installerCreationService)); |
|
76 |
pluginListModel = new PluginListModel(installerCreationService); |
|
77 |
pluginList.setModel(pluginListModel); |
|
71 | 78 |
pluginList.setCellRenderer(new PluginListCellRenderer(this)); |
72 | 79 |
} |
73 | 80 |
|
74 | 81 |
private void initComponents() { |
75 |
java.awt.GridBagConstraints gridBagConstraints; |
|
76 | 82 |
|
77 | 83 |
pluginScrollPane1 = new JScrollPane(); |
78 | 84 |
pluginList = new JList(); |
79 |
|
|
80 |
setLayout(new GridBagLayout()); |
|
81 |
|
|
82 | 85 |
pluginScrollPane1.setViewportView(pluginList); |
86 |
|
|
87 |
chkShowFullPath = new JCheckBox("Show full paths", false); |
|
88 |
chkShowFullPath.setHorizontalAlignment(SwingConstants.RIGHT); |
|
89 |
chkShowFullPath.addActionListener(new ActionListener() { |
|
90 |
public void actionPerformed(ActionEvent ae) { |
|
91 |
pluginListModel.refresh(); |
|
92 |
} |
|
93 |
}); |
|
83 | 94 |
|
84 |
gridBagConstraints = new GridBagConstraints(); |
|
85 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
86 |
gridBagConstraints.weightx = 1.0; |
|
87 |
gridBagConstraints.weighty = 1.0; |
|
88 |
add(pluginScrollPane1, gridBagConstraints); |
|
95 |
// java.awt.GridBagConstraints gridBagConstraints; |
|
96 |
// setLayout(new GridBagLayout()); |
|
97 |
// gridBagConstraints = new GridBagConstraints(); |
|
98 |
// gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
99 |
// gridBagConstraints.weightx = 1.0; |
|
100 |
// gridBagConstraints.weighty = 1.0; |
|
101 |
// add(pluginScrollPane1, gridBagConstraints); |
|
102 |
|
|
103 |
|
|
104 |
setLayout(new BorderLayout()); |
|
105 |
this.add(pluginScrollPane1, BorderLayout.CENTER); |
|
106 |
this.add(chkShowFullPath,BorderLayout.SOUTH); |
|
89 | 107 |
} |
90 | 108 |
|
109 |
public boolean getShowFullPaths() { |
|
110 |
return this.chkShowFullPath.isSelected(); |
|
111 |
} |
|
112 |
|
|
91 | 113 |
/** |
92 | 114 |
* @return the selectedPlugin |
93 | 115 |
*/ |
Also available in: Unified diff