Revision 37598 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/DefaultJShowUnresolvedDependenciesAndAskContinuePanel.java
DefaultJShowUnresolvedDependenciesAndAskContinuePanel.java | ||
---|---|---|
18 | 18 |
import org.gvsig.installer.swing.api.SwingInstallerManager; |
19 | 19 |
import org.gvsig.installer.swing.api.execution.JShowUnresolvedDependenciesAndAskContinuePanel; |
20 | 20 |
|
21 |
public class DefaultJShowUnresolvedDependenciesAndAskContinuePanel extends JShowUnresolvedDependenciesAndAskContinuePanel implements ActionListener { |
|
21 |
public class DefaultJShowUnresolvedDependenciesAndAskContinuePanel extends |
|
22 |
JShowUnresolvedDependenciesAndAskContinuePanel implements |
|
23 |
ActionListener { |
|
22 | 24 |
|
23 |
|
|
24 | 25 |
/** |
25 | 26 |
* |
26 | 27 |
*/ |
27 | 28 |
private static final long serialVersionUID = 2135985029410816305L; |
28 | 29 |
private Dependencies dependencies; |
29 | 30 |
private boolean doCancel = true; |
30 |
|
|
31 |
public DefaultJShowUnresolvedDependenciesAndAskContinuePanel(SwingInstallerManager manager, Dependencies dependencies, String message) { |
|
32 |
// this.buildPackageList(dependencies); |
|
31 |
|
|
32 |
public DefaultJShowUnresolvedDependenciesAndAskContinuePanel( |
|
33 |
SwingInstallerManager manager, Dependencies dependencies, |
|
34 |
String message) { |
|
35 |
// this.buildPackageList(dependencies); |
|
33 | 36 |
this.dependencies = dependencies; |
34 | 37 |
this.createUI(manager, message); |
35 | 38 |
} |
36 |
|
|
37 |
// private void buildPackageList(Dependencies dependencies) { |
|
38 |
// this.dependencies = new ArrayList<String>(); |
|
39 |
// for( int i=0 ; i<packages.size(); i++ ) { |
|
40 |
// PackageInfo pkg = packages.get(i); |
|
41 |
// this.packages.add(pkg.getName()); |
|
42 |
// } |
|
43 |
// } |
|
44 |
|
|
45 |
private void createUI(SwingInstallerManager manager,String message) { |
|
46 |
this.setLayout( new BorderLayout()); |
|
47 |
|
|
48 |
JButton cancelButton = new JButton("Cancel"); |
|
49 |
cancelButton.setActionCommand("cancel"); |
|
50 |
cancelButton.addActionListener(this); |
|
51 |
// |
|
52 |
final JButton continueButton = new JButton("Continue"); |
|
53 |
continueButton.setActionCommand("continue"); |
|
54 |
continueButton.addActionListener(this); |
|
55 | 39 |
|
56 |
JList list = new JList(this.dependencies.toArray()); |
|
40 |
// private void buildPackageList(Dependencies dependencies) { |
|
41 |
// this.dependencies = new ArrayList<String>(); |
|
42 |
// for( int i=0 ; i<packages.size(); i++ ) { |
|
43 |
// PackageInfo pkg = packages.get(i); |
|
44 |
// this.packages.add(pkg.getName()); |
|
45 |
// } |
|
46 |
// } |
|
57 | 47 |
|
58 |
JScrollPane listScroller = new JScrollPane(list); |
|
59 |
listScroller.setPreferredSize(new Dimension(250, 80)); |
|
60 |
listScroller.setAlignmentX(LEFT_ALIGNMENT); |
|
48 |
private void createUI(SwingInstallerManager manager, String message) { |
|
49 |
this.setLayout(new BorderLayout()); |
|
61 | 50 |
|
62 |
JPanel listPane = new JPanel(); |
|
63 |
listPane.setLayout(new BoxLayout(listPane, BoxLayout.PAGE_AXIS)); |
|
64 |
JLabel label = new JLabel(message); |
|
65 |
label.setLabelFor(list); |
|
66 |
listPane.add(label); |
|
67 |
listPane.add(Box.createRigidArea(new Dimension(0,5))); |
|
68 |
listPane.add(listScroller); |
|
69 |
listPane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); |
|
51 |
JButton cancelButton = new JButton(manager.getText("_cancel")); |
|
52 |
cancelButton.setActionCommand("cancel"); |
|
53 |
cancelButton.addActionListener(this); |
|
54 |
// |
|
55 |
final JButton continueButton = new JButton(manager.getText("_continue")); |
|
56 |
continueButton.setActionCommand("continue"); |
|
57 |
continueButton.addActionListener(this); |
|
70 | 58 |
|
71 |
JPanel buttonPane = new JPanel(); |
|
72 |
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); |
|
73 |
buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); |
|
74 |
buttonPane.add(Box.createHorizontalGlue()); |
|
75 |
buttonPane.add(cancelButton); |
|
76 |
buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); |
|
77 |
buttonPane.add(continueButton); |
|
59 |
JList list = new JList(this.dependencies.toArray()); |
|
78 | 60 |
|
79 |
this.add(listPane, BorderLayout.CENTER); |
|
80 |
this.add(buttonPane, BorderLayout.PAGE_END); |
|
61 |
JScrollPane listScroller = new JScrollPane(list); |
|
62 |
listScroller.setPreferredSize(new Dimension(250, 80)); |
|
63 |
listScroller.setAlignmentX(LEFT_ALIGNMENT); |
|
64 |
|
|
65 |
JPanel listPane = new JPanel(); |
|
66 |
listPane.setLayout(new BoxLayout(listPane, BoxLayout.PAGE_AXIS)); |
|
67 |
JLabel label = new JLabel(message); |
|
68 |
label.setLabelFor(list); |
|
69 |
listPane.add(label); |
|
70 |
listPane.add(Box.createRigidArea(new Dimension(0, 5))); |
|
71 |
listPane.add(listScroller); |
|
72 |
listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
|
73 |
|
|
74 |
JPanel buttonPane = new JPanel(); |
|
75 |
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); |
|
76 |
buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); |
|
77 |
buttonPane.add(Box.createHorizontalGlue()); |
|
78 |
buttonPane.add(cancelButton); |
|
79 |
buttonPane.add(Box.createRigidArea(new Dimension(10, 0))); |
|
80 |
buttonPane.add(continueButton); |
|
81 |
|
|
82 |
this.add(listPane, BorderLayout.CENTER); |
|
83 |
this.add(buttonPane, BorderLayout.PAGE_END); |
|
81 | 84 |
} |
82 |
|
|
85 |
|
|
83 | 86 |
public boolean cancelled() { |
84 | 87 |
return doCancel; |
85 | 88 |
} |
86 |
|
|
89 |
|
|
87 | 90 |
public boolean needShow() { |
88 |
return this.dependencies.size()>0;
|
|
91 |
return this.dependencies.size() > 0;
|
|
89 | 92 |
} |
90 | 93 |
|
91 | 94 |
public void actionPerformed(ActionEvent e) { |
Also available in: Unified diff