Revision 2139 org.gvsig.raster.tools/trunk/templates/rasterTaskProjectTemplate/alg_with_preview_template/sources/app/ProjectTemplateExtension.java
ProjectTemplateExtension.java | ||
---|---|---|
25 | 25 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
26 | 26 |
import org.gvsig.raster.projecttemplate.swing.ProjectTemplatePanel; |
27 | 27 |
import org.gvsig.raster.projecttemplate.swing.ProjectTemplateSwingLocator; |
28 |
import org.gvsig.raster.swing.RasterSwingLibrary; |
|
28 | 29 |
import org.gvsig.raster.swing.RasterSwingLocator; |
29 | 30 |
import org.gvsig.raster.swing.newlayer.CreateNewLayerPanel; |
30 | 31 |
import org.gvsig.raster.swing.newlayer.FileNameManagement; |
... | ... | |
78 | 79 |
public void execute(String actionCommand) { |
79 | 80 |
if (actionCommand.compareTo("ProjectTemplate") == 0) { |
80 | 81 |
if(getSelectedLayer() == null) { |
81 |
messageBoxError("layer_not_selected", null, null);
|
|
82 |
RasterSwingLibrary.messageBoxError("layer_not_selected", null);
|
|
82 | 83 |
return; |
83 | 84 |
} |
84 | 85 |
try { |
... | ... | |
214 | 215 |
|
215 | 216 |
} |
216 | 217 |
|
217 |
/** |
|
218 |
* Shows a error dialog with a text and a accept button |
|
219 |
* @param msg Message to show in the dialog |
|
220 |
* @param parentWindow Parent window |
|
221 |
*/ |
|
222 |
public static void messageBoxError(String msg, Object parentWindow, Exception exception) { |
|
223 |
if(exception != null) { |
|
224 |
LoggerFactory.getLogger(ProjectTemplateExtension.class).debug(Messages.getText(msg), exception); |
|
225 |
} |
|
226 |
String string = Messages.getText("accept"); |
|
227 |
Object[] options = {string}; |
|
228 |
JOptionPane.showOptionDialog((Component)parentWindow, |
|
229 |
"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>", |
|
230 |
Messages.getText("confirmacion"), |
|
231 |
JOptionPane.OK_OPTION, |
|
232 |
JOptionPane.ERROR_MESSAGE, |
|
233 |
null, |
|
234 |
options, |
|
235 |
string); |
|
236 |
} |
|
237 |
|
|
238 | 218 |
public class FileNameManagementImpl implements FileNameManagement { |
239 | 219 |
private FileUtils fileUtils = RasterLocator.getManager().getFileUtils(); |
240 | 220 |
|
Also available in: Unified diff