Revision 42200 trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/ui/wizard/UnsavedDataPanel.java
UnsavedDataPanel.java | ||
---|---|---|
37 | 37 |
import java.awt.event.MouseListener; |
38 | 38 |
import java.awt.image.BufferedImage; |
39 | 39 |
import java.util.ArrayList; |
40 |
import java.util.Arrays; |
|
40 | 41 |
import java.util.Iterator; |
42 |
import java.util.List; |
|
41 | 43 |
|
42 | 44 |
import javax.swing.BorderFactory; |
43 | 45 |
import javax.swing.ImageIcon; |
... | ... | |
84 | 86 |
private JLabel lblResourceDescription = null; |
85 | 87 |
private IUnsavedData[] unsavedDataList; |
86 | 88 |
private String windowTitle = PluginServices.getText(this, "save_resources"); |
89 |
private String prompt = PluginServices.getText(this, "select_resources_to_save_before_exit"); |
|
87 | 90 |
|
88 | 91 |
|
89 | 92 |
|
... | ... | |
96 | 99 |
this.setUnsavedDataArray(unsavedDatalist); |
97 | 100 |
} |
98 | 101 |
|
102 |
public UnsavedDataPanel(String prompt) { |
|
103 |
super(); |
|
104 |
initialize(); |
|
105 |
this.setUnsavedDataArray(new IUnsavedData[0]); |
|
106 |
this.prompt = prompt; |
|
107 |
} |
|
108 |
|
|
109 |
|
|
99 | 110 |
/** |
100 | 111 |
* This method initializes this |
101 | 112 |
* |
... | ... | |
107 | 118 |
borderLayout.setVgap(5); |
108 | 119 |
lblDescription = new JLabel(); |
109 | 120 |
lblDescription.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
110 |
lblDescription.setText(PluginServices.getText(this, "select_resources_to_save_before_exit"));
|
|
121 |
lblDescription.setText(prompt);
|
|
111 | 122 |
lblDescription.setPreferredSize(new Dimension(497, 30)); |
112 | 123 |
lblDescription.setName("lblDescription"); |
113 | 124 |
this.setLayout(borderLayout); |
... | ... | |
253 | 264 |
*/ |
254 | 265 |
private JPanel getPActionButtons() { |
255 | 266 |
if (pActionButtons == null) { |
256 |
|
|
267 |
|
|
257 | 268 |
GridLayout gl = new GridLayout(1, 3, 8, 0); |
258 | 269 |
/* |
259 | 270 |
FlowLayout flowLayout = new FlowLayout(); |
... | ... | |
293 | 304 |
pSelectionButtons.add(getBotDeselectAll()); |
294 | 305 |
pSelectionButtons.add(new JLabel()); |
295 | 306 |
pSelectionButtons.add(new JLabel()); |
296 |
|
|
307 |
|
|
297 | 308 |
} |
298 | 309 |
return pSelectionButtons; |
299 | 310 |
} |
... | ... | |
646 | 657 |
|
647 | 658 |
} |
648 | 659 |
|
660 |
/** |
|
661 |
* Set the resorces to ask for |
|
662 |
* |
|
663 |
* @param IUnsavedData[] resources pending to save |
|
664 |
*/ |
|
665 |
public void setUnsavedData(List<IUnsavedData> unsavedDatalist){ |
|
666 |
setUnsavedDataArray(unsavedDatalist.toArray(new IUnsavedData[0])); |
|
667 |
} |
|
649 | 668 |
|
669 |
public List<IUnsavedData> getSelectedsUnsavedDataList(){ |
|
670 |
return Arrays.asList(this.getSelectedsUnsavedData()); |
|
671 |
} |
|
672 |
|
|
650 | 673 |
private IUnsavedData[] getUnsavedData(boolean selected){ |
651 | 674 |
int i; |
652 | 675 |
myList theList = getList(); |
Also available in: Unified diff