Revision 896

View differences:

org.gvsig.tools/library/trunk/org.gvsig.tools/dynform/src/org/gvsig/tools/dynform/impl/dynformfield/URI/JDynFormFieldURI.java
1 1
package org.gvsig.tools.dynform.impl.dynformfield.URI;
2 2

  
3 3
import java.io.File;
4
import java.net.MalformedURLException;
4 5
import java.net.URI;
5 6
import java.net.URISyntaxException;
7
import java.net.URL;
6 8

  
7 9
import javax.swing.JFileChooser;
8 10

  
......
51 53
	public void setValue(Object value) {
52 54
		if( value == null ) {
53 55
			this.jtext.setText("");
56
			this.assignedValue = null;
54 57
		} else {
55 58
			if( !(value instanceof URI) ) {
56 59
				logger.info("setValue invoked with non URI value ("+value.toString()+").");
57 60
				return;
58 61
			}
59 62
			this.jtext.setText(((URI)value).getPath());
63
			try {
64
				this.assignedValue = new URI(((URI)value).getPath());
65
			} catch (URISyntaxException e) {
66
				logger.info("Error in URI creation.");
67
				this.assignedValue = null;
68
			}
60 69
		}
61
		try {
62
			this.assignedValue = new URI(((URI)value).getPath());
63
		} catch (URISyntaxException e) {
64
			logger.info("Error in URI creation.");
65
			this.assignedValue = null;
66
		}
70
		
67 71
		this.currentValue = this.assignedValue;
72
		
68 73
	}
69 74
	
70 75
	public File[] showOpenFileDialog(String title, File initialPath) {

Also available in: Unified diff