Revision 19900 branches/v10/extensions/extPublish/src/org/gvsig/publish/gui/wizard/PublishWizardController.java
PublishWizardController.java | ||
---|---|---|
43 | 43 |
import java.awt.event.ActionEvent; |
44 | 44 |
import java.awt.event.ActionListener; |
45 | 45 |
|
46 |
import javax.swing.event.ChangeEvent; |
|
47 |
import javax.swing.event.ChangeListener; |
|
46 | 48 |
import javax.swing.event.TreeSelectionEvent; |
47 | 49 |
import javax.swing.event.TreeSelectionListener; |
48 | 50 |
|
... | ... | |
59 | 61 |
* @author jvhigon |
60 | 62 |
* |
61 | 63 |
*/ |
62 |
public abstract class PublishWizardController implements IPublishPluginController, ActionListener, TreeSelectionListener { |
|
64 |
public abstract class PublishWizardController implements IPublishPluginController, ActionListener, TreeSelectionListener, ChangeListener {
|
|
63 | 65 |
//Associations |
64 | 66 |
private PublishWizardPanel panel; |
65 | 67 |
private Publication publication; |
... | ... | |
231 | 233 |
//update gui |
232 | 234 |
setPanels(); |
233 | 235 |
} |
236 |
/** |
|
237 |
* Change tab method |
|
238 |
* @param e |
|
239 |
*/ |
|
240 |
public void stateChanged(ChangeEvent e) { |
|
241 |
getModel(); |
|
242 |
int tab = panel.getSelectedTab(); |
|
243 |
if (tab==0){ |
|
244 |
panel.setEnabledPrevButton(false); |
|
245 |
}else{ |
|
246 |
panel.setEnabledPrevButton(true); |
|
247 |
} |
|
248 |
if (tab==2){ |
|
249 |
panel.setEnabledNextButton(false); |
|
250 |
//if there isn't resource the addresource use case is called |
|
251 |
if (publication.getServer().getService(0).getRemoteResourcesCount() == 0){ |
|
252 |
AddResourceController addResourceCtrl = new AddResourceController(); |
|
253 |
addResourceCtrl.setPublication(publication); |
|
254 |
addResourceCtrl.showWindow(); |
|
255 |
panel.setSelectedTab(2); |
|
256 |
} |
|
257 |
}else{ |
|
258 |
panel.setEnabledNextButton(true); |
|
259 |
} |
|
260 |
} |
|
234 | 261 |
|
235 | 262 |
} |
Also available in: Unified diff