Revision 46573 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/LayerPropertiesExtension.java
LayerPropertiesExtension.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.app.extension; |
24 | 24 |
|
25 |
import javax.swing.JOptionPane; |
|
25 | 26 |
import org.gvsig.andami.IconThemeHelper; |
26 | 27 |
import org.gvsig.andami.plugins.Extension; |
27 | 28 |
import org.gvsig.app.ApplicationLocator; |
... | ... | |
38 | 39 |
import org.gvsig.tools.ToolsLocator; |
39 | 40 |
import org.gvsig.tools.i18n.I18nManager; |
40 | 41 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
42 |
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
|
41 | 43 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
42 | 44 |
|
43 | 45 |
public class LayerPropertiesExtension extends Extension { |
... | ... | |
71 | 73 |
|
72 | 74 |
if (s.equalsIgnoreCase("layer-properties")) { |
73 | 75 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
74 |
FLayer layer = document.getMapContext().getLayers().getActives()[0]; |
|
76 |
FLayer[] activeLayers = document.getMapContext().getLayers().getActives(); |
|
77 |
FLayer layer = activeLayers[0]; |
|
78 |
|
|
79 |
if( activeLayers.length>1 ) { |
|
80 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
81 |
int n = dialogs.confirmDialog( |
|
82 |
i18n.getTranslation("_There_is_more_than_one_active_layer") + |
|
83 |
"\n" + |
|
84 |
i18n.getTranslation( |
|
85 |
"_If_you_continue_the_properties_of_layer_0_will_be_displayed", |
|
86 |
new String[] { layer.getName() } |
|
87 |
) + |
|
88 |
"\n" + |
|
89 |
i18n.getTranslation("_Do_you_wish_to_continue"), |
|
90 |
i18n.getTranslation("_Show_properties"), |
|
91 |
JOptionPane.YES_NO_OPTION, |
|
92 |
JOptionPane.QUESTION_MESSAGE, |
|
93 |
"_If_you_continue_the_properties_of_layer_0_will_be_displayed" |
|
94 |
); |
|
95 |
if( n != JOptionPane.YES_OPTION ) { |
|
96 |
return; |
|
97 |
} |
|
98 |
} |
|
75 | 99 |
String title = null; |
76 | 100 |
if( layer instanceof SingleLayer ) { |
77 | 101 |
DataStore store = ((SingleLayer) layer).getDataStore(); |
Also available in: Unified diff