Revision 1110

View differences:

org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/DynFormManager.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import java.util.List;
27

  
28
import org.gvsig.tools.dynobject.DynObject;
29
import org.gvsig.tools.dynobject.DynObjectSet;
30
import org.gvsig.tools.dynobject.DynStruct;
31
import org.gvsig.tools.service.Manager;
32
import org.gvsig.tools.service.ServiceException;
33

  
34
public interface DynFormManager extends Manager {
35

  
36
	public DynFormDefinition getDefinition(String name);
37
	public DynFormDefinition getDefinition(DynStruct definition);
38
	public DynFormDefinition getDefinition(DynObject obj);
39
	
40
	public JDynForm createJDynForm(DynFormDefinition definition) throws ServiceException;
41
	public JDynForm createJDynForm(DynStruct struct) throws ServiceException;
42
	public JDynForm createJDynForm(DynObject obj) throws ServiceException;
43
	
44
        public String getDefaultJDynFormSetName();
45
        public void setDefaultJDynFormSetName(String name);
46
        
47
	public JDynFormSet createJDynFormSet(DynFormDefinition definition) throws ServiceException;
48
	public JDynFormSet createJDynFormSet(DynStruct struct) throws ServiceException;
49
	public JDynFormSet createJDynFormSet(List data) throws ServiceException;
50
	public JDynFormSet createJDynFormSet(DynObjectSet data) throws ServiceException;	
51
        
52
        public JDynFormSet createJDynFormSet(String type, DynFormDefinition definition) throws ServiceException;
53
	public JDynFormSet createJDynFormSet(String type, DynStruct struct) throws ServiceException;
54
	public JDynFormSet createJDynFormSet(String type, List data) throws ServiceException;
55
	public JDynFormSet createJDynFormSet(String type, DynObjectSet data) throws ServiceException;
56

  
57
}
0 58

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/DynFormFieldDefinition.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import org.gvsig.tools.dynobject.DynField;
27
import org.gvsig.tools.dynobject.DynField_v2;
28

  
29
public interface DynFormFieldDefinition extends DynField_v2 {
30

  
31
	public String getGroup();
32
	public String getSubgroup();
33
	
34
	public String getGroups();
35
	public String getLabel();
36
	
37
	public DynField setLabel(String label);
38
	public void setGroups(String groups);
39
	
40
}
0 41

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/JDynFormField.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import javax.swing.Action;
27
import javax.swing.JComponent;
28

  
29
import org.gvsig.tools.service.Service;
30
import org.gvsig.tools.swing.api.Component;
31

  
32
public interface JDynFormField extends Component, Service {
33
	
34
	public interface JDynFormFieldListener {
35
		public void fieldEnter(JDynFormField field);
36
		public void fieldExit(JDynFormField field);
37
		public void fieldChanged(JDynFormField field);
38
		public void message(JDynFormField field, String message);
39
	}
40
	
41
	public DynFormFieldDefinition getDefinition();
42
	
43
	public String getName();
44
	
45
	public String getLabel();
46
	
47
	public JComponent getJLabel();
48

  
49
	public boolean hasValidValue();
50
	
51
	public void setValue(Object value);
52
	
53
	public boolean isModified();
54
	
55
	/**
56
	 * Get the value of field from the form.
57
	 * 
58
	 * Throw an exception if the value of form is not valid
59
	 * for this field.
60
	 * 
61
	 * @return value of field 
62
	 */
63
	public Object getValue();
64
	
65
	public void addListener(JDynFormFieldListener listener);
66
	
67
	public void removeListener(JDynFormFieldListener listener);
68
	
69
	public void setReadOnly(boolean readonly);
70
	
71
	public boolean isReadOnly();
72
	
73
	public void addActionToPopupMenu(String name, Action action);
74

  
75
	public void addSeparatorToPopupMenu();
76

  
77
	public void fireMessageEvent(String message);
78
}
0 79

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/DynFormLocator.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import org.gvsig.tools.locator.AbstractLocator;
27
import org.gvsig.tools.locator.Locator;
28
import org.gvsig.tools.locator.LocatorException;
29

  
30
@SuppressWarnings("rawtypes")
31
public class DynFormLocator extends AbstractLocator {
32

  
33
	private static final String LOCATOR_NAME = "DynFormsLocator";
34
	
35
	public static final String DYNFORM_MANAGER_NAME =
36
			"org.gvsig.tools.dynform.manager";
37

  
38
	private static final String DYNFORM_MANAGER_DESCRIPTION =
39
			"Persistence Manager of gvSIG";
40
	
41
	private static final DynFormLocator instance = new DynFormLocator();
42

  
43
	private DynFormLocator() {
44

  
45
	}
46

  
47
	/**
48
	 * Return the singleton instance.
49
	 * 
50
	 * @return the singleton instance
51
	 */
52
	public static DynFormLocator getInstance() {
53
		return instance;
54
	}
55

  
56
	public String getLocatorName() {
57
		return LOCATOR_NAME;
58
	}
59

  
60
	/**
61
	 * Return a reference to DynFormManager.
62
	 * 
63
	 * @return a reference to DynFormManager
64
	 * @throws LocatorException
65
	 *             if there is no access to the class or the class cannot be
66
	 *             instantiated
67
	 * @see Locator#get(String)
68
	 */
69
	public static DynFormManager getDynFormManager()
70
			throws LocatorException {
71
		return (DynFormManager) getInstance().get(DYNFORM_MANAGER_NAME);
72
	}
73

  
74
	/**
75
	 * Registers the Class implementing the DynFormManager interface.
76
	 * 
77
	 * @param clazz
78
	 *            implementing the DynFormManager interface
79
	 */
80
	public static void registerDynFormManager(Class clazz) {
81
		getInstance().register(DYNFORM_MANAGER_NAME,
82
				DYNFORM_MANAGER_DESCRIPTION, clazz);
83
	}
84

  
85
	public static void registerDefaultDynFormManager(Class clazz) {
86
		getInstance().registerDefault(DYNFORM_MANAGER_NAME,
87
				DYNFORM_MANAGER_DESCRIPTION, clazz);
88
	}
89

  
90

  
91
}
0 92

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/DynFormLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import org.gvsig.tools.ToolsLibrary;
27
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
30

  
31
public class DynFormLibrary extends AbstractLibrary {
32

  
33
	public void doRegistration() {
34
		super.doRegistration();
35
		registerAsAPI(DynFormLibrary.class);
36
		this.require(ToolsLibrary.class);
37
	}
38
	
39
	protected void doInitialize() throws LibraryException {
40
		
41
	}
42

  
43
	protected void doPostInitialize() throws LibraryException {
44
		  // Validate there is any implementation registered.
45
        DynFormManager manager = DynFormLocator.getDynFormManager();
46
        if (manager == null) {
47
            throw new ReferenceNotRegisteredException(
48
            		DynFormLocator.DYNFORM_MANAGER_NAME, DynFormLocator
49
                    .getInstance());
50
        }
51
        
52
	}
53

  
54
}
0 55

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/AbortActionException.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import org.gvsig.tools.exception.BaseException;
27

  
28
public class AbortActionException extends BaseException {
29

  
30
	/**
31
	 * 
32
	 */
33
	private static final long serialVersionUID = 3461167266495124406L;
34

  
35
}
0 36

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/JDynFormSet.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import java.util.List;
27

  
28
import javax.swing.Action;
29

  
30
import org.gvsig.tools.dataTypes.DataType;
31
import org.gvsig.tools.dynobject.DynObject;
32
import org.gvsig.tools.dynobject.DynObjectSet;
33
import org.gvsig.tools.service.ServiceException;
34
import org.gvsig.tools.swing.api.Component;
35

  
36
public interface JDynFormSet  extends Component {
37

  
38
	public static final int USE_PLAIN = 0;
39
	public static final int USE_TABS = 1;
40
	public static final int USE_SEPARATORS = 2;
41
	
42
	public interface JDynFormSetListener {
43
		public void formMessage(String message);
44
		public void formClose();
45
		public void formMovedTo(int currentPosition);
46
		
47
		public void formBeforeSave(JDynFormSet dynformSet) throws AbortActionException;
48
		public void formBeforeNew(JDynFormSet dynformSet) throws AbortActionException;
49
		public void formBeforeDelete(JDynFormSet dynformSet) throws AbortActionException;
50
		public void formBeforeSearch(JDynFormSet dynformSet) throws AbortActionException;
51

  
52
		public void formAfterSave(JDynFormSet dynformSet);
53
		public void formAfterNew(JDynFormSet dynformSet);
54
		public void formAfterDelete(JDynFormSet dynformSet);
55
		public void formAfterSearch(JDynFormSet dynformSet);
56
	}
57
		
58
	public void setLayoutMode(int layoutMode);
59
	public int getLayoutMode();
60
	
61
	public void setValues(DynObjectSet values) throws ServiceException;
62
	public void setValues(List values) throws ServiceException;
63
	
64
	public void message();
65
	public void message(String msg);
66

  
67
	public void setReadOnly(boolean readOnly);
68
	public boolean isReadOnly();
69
	
70
	public void addListener(JDynFormSetListener listener);
71
	public void removeListener(JDynFormSetListener listener);
72
	
73
	public boolean isAutosave();
74
	public void setAutosave(boolean autosave);
75
	
76
	public boolean allowUpdate();
77
	public boolean allowDelete();
78
	public boolean allowNew();
79
	public boolean allowSearch();
80
	public boolean allowClose();
81

  
82
	public void setAllowUpdate(boolean allowUpdate);
83
	public void setAllowDelete(boolean allowDelete);
84
	public void setAllowNew(boolean allowNew);
85
	public void setAllowSearch(boolean allowSearch);
86
	public void setAllowClose(boolean allowClose);
87
	
88
	public void setFormSize(int width, int height);
89
	
90
	public DynObject get(int position);
91
	public int getCurrentIndex();
92
	public int countValues();
93
	public void setCurrentIndex(int index);
94
	
95
	public void addActionToPopupMenu(DataType tipo, String name, Action action);
96
	public void addSeparatorToPopupMenu(DataType tipo);
97
	
98
	public void setUseScrollBars(boolean usesScrolls);
99
	public boolean getUseScrollBars();
100
	
101
	
102
}
0 103

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/DynFormDefinition.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import java.util.List;
27

  
28
import org.gvsig.tools.dynobject.DynField;
29
import org.gvsig.tools.dynobject.DynObject;
30
import org.gvsig.tools.dynobject.DynStruct;
31
import org.gvsig.tools.dynobject.Tags;
32

  
33
@SuppressWarnings("rawtypes")
34
public interface DynFormDefinition {
35

  
36
	public String getName();
37
	
38
	public List getGroups();
39
	
40
	public List getSubgroups(String group);
41
	
42
	public List getDefinitions();
43

  
44
	public List getDefinitions(String group);
45
	
46
	public List getDefinitions(String group, String subgroup);
47
	
48
	public int getGroupOrder(String group);
49
	
50
	public void setGroupOrder(String group, int order);
51
	
52
	public void add(DynStruct definition);
53
	
54
	public DynFormFieldDefinition add(DynField definition);
55
	
56
	public DynFormFieldDefinition get(String name);
57
	
58
	public DynFormFieldDefinition get(int index);
59
	
60
	public void remove(String name);
61
	
62
	public int size();
63
	
64
	public Tags getTags();
65

  
66
	public DynObject createElement();
67
	
68
	public void setElementsType(DynStruct struct);
69

  
70
	public DynStruct getElementsType();
71

  
72
}
0 73

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/java/org/gvsig/tools/dynform/JDynForm.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform;
25

  
26
import java.util.List;
27

  
28
import javax.swing.Action;
29

  
30
import org.gvsig.tools.dataTypes.DataType;
31
import org.gvsig.tools.dynobject.DynObject;
32
import org.gvsig.tools.swing.api.Component;
33

  
34
public interface JDynForm extends Component {
35

  
36
	public interface JDynFormListener {
37
		public void message(String message);
38
                /**
39
                 * This event is fired when a field of the form is changed by the user.
40
                 * 
41
                 * Now this is not yet implemented.
42
                 * 
43
                 * @param field 
44
                 */
45
		public void fieldChanged(JDynFormField field);
46
	}
47
	
48
	public static final int USE_PLAIN = 0;
49
	public static final int USE_TABS = 1;
50
	public static final int USE_SEPARATORS = 2;
51
	public static final int USE_TREE = 3;
52
	
53
	public void setLayoutMode(int layoutMode);
54
	public int getLayoutMode();
55
	
56
	public int getFormWidth();
57
	public int getFormHeight();
58
	public void setFormSize(int width, int height);
59
	
60
	public JDynFormField getField(String fieldName);
61
	
62
	public DynFormDefinition getDefinition();
63
	
64
	public void setValues(DynObject values);
65
	public void getValues(DynObject values);
66
	
67
	public Object getValue(String fieldName);
68
	public void setValue(String fieldName, Object value);
69
	
70
	public boolean haveValidValues();
71
	public boolean haveValidValues(List<String> fieldsName);
72
	
73
	public void message();
74
	
75
	public void message(String msg);
76

  
77
	public void setReadOnly(boolean readOnly);
78
	public boolean isReadOnly();
79
	
80
	public void setShowMessageStatus(boolean showMessageStatus);
81
	
82
	public boolean isShowMessageStatus();
83
	
84
	public void setUseScrollBars(boolean usesScrolls);
85
	public boolean getUseScrollBars();
86
	
87
	public boolean isModified();
88
	
89
	public void addListener(JDynFormListener listener);
90
	public void removeListener(JDynFormListener listener);
91
	
92
	public void addActionToPopupMenu(DataType tipo, String name, Action action);
93
	public void addSeparatorToPopupMenu(DataType tipo);
94
}
0 95

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.tools.dynform.DynFormLibrary
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.api/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2
  <modelVersion>4.0.0</modelVersion>
3
  <packaging>jar</packaging>
4
  <artifactId>org.gvsig.tools.dynform.api</artifactId>
5
  <name>org.gvsig.tools.dynform.api</name>
6
  <description>DynForms API</description>
7
  <parent>
8
    <groupId>org.gvsig</groupId>
9
    <artifactId>org.gvsig.tools.dynform</artifactId>
10
    <version>3.0.31</version>
11
  </parent>
12
  <dependencies>
13
  	<dependency>
14
  		<groupId>org.gvsig</groupId>
15
  		<artifactId>org.gvsig.tools.lib</artifactId>
16
  	</dependency>
17
  	<dependency>
18
  		<groupId>org.gvsig</groupId>
19
  		<artifactId>org.gvsig.tools.swing.api</artifactId>
20
  	</dependency>
21
  </dependencies>
22
</project>
0 23

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.tools.dynform</artifactId>
5
	<packaging>pom</packaging>
6
	<name>org.gvsig.tools.dynform</name>
7
	<description>Add support to DynForms</description>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.tools</artifactId>
11
		<version>3.0.31</version>
12
	</parent>
13

  
14
	<modules>
15
		<module>org.gvsig.tools.dynform.api</module>
16
		<module>org.gvsig.tools.dynform.spi</module>
17
		<module>org.gvsig.tools.dynform.services</module>
18
		<module>org.gvsig.tools.dynform.impl</module>
19
	</modules>
20
</project>
0 21

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.tools.dynform.spi.DynFormSPILibrary
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/DynFormSPILibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi;
25

  
26
import org.gvsig.tools.dynform.DynFormLibrary;
27
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29

  
30
public class DynFormSPILibrary extends AbstractLibrary {
31

  
32
	public void doRegistration() {
33
		super.doRegistration();
34
		registerAsServiceOf(DynFormLibrary.class);
35
	}
36
	
37
	protected void doInitialize() throws LibraryException {
38
		
39
	}
40

  
41
	protected void doPostInitialize() throws LibraryException {
42
		
43
	}
44

  
45
}
0 46

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/AbstractJDynFormFieldWithValueList.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import java.awt.event.FocusEvent;
27
import java.awt.event.FocusListener;
28
import java.awt.event.KeyAdapter;
29
import java.awt.event.KeyEvent;
30

  
31
import javax.swing.JComboBox;
32
import javax.swing.JTextField;
33
import javax.swing.text.JTextComponent;
34
import org.apache.commons.lang3.StringUtils;
35

  
36
import org.gvsig.tools.dataTypes.CoercionException;
37
import org.gvsig.tools.dynform.JDynFormField;
38
import org.gvsig.tools.dynform.spi.dynformfield.AbstractJDynFormField.IllegalFieldValue;
39
import org.gvsig.tools.dynobject.DynObject;
40
import org.gvsig.tools.dynobject.DynObjectValueItem;
41
import org.gvsig.tools.dynobject.exception.DynFieldValidateException;
42
import org.gvsig.tools.service.spi.ServiceManager;
43

  
44
public abstract class AbstractJDynFormFieldWithValueList extends AbstractJDynFormField implements JDynFormField, FocusListener {
45
	
46
	protected Object assignedValue  = null;
47
	
48
	public AbstractJDynFormFieldWithValueList(DynObject parameters,
49
			ServiceManager serviceManager) {
50
		super(parameters, serviceManager);
51
		this.assignedValue = this.getParameterValue();
52
	}
53

  
54
	public Object getAssignedValue() {
55
		return this.assignedValue;
56
	}
57

  
58
	protected JTextField getJTextField() {
59
		return (JTextField) this.contents;
60
	}
61
	
62
	protected JComboBox getJComboBox() {
63
		return (JComboBox) this.contents;
64
	}
65
		
66
	public void initComponent() {
67
		DynObjectValueItem[] availableValues = this.getDefinition().getAvailableValues();
68
		if( availableValues==null ) {
69
			this.contents = new JCustomTextField(this.getLabel());
70
			//this.contents.addKeyListener(new KeyAdapterRegEx());
71
			this.contents.addFocusListener(this);
72
			if( this.getDefinition().isReadOnly() ) {
73
				this.getJTextField().setEditable(false);;
74
			}
75
		} else {
76
			this.contents = new JComboBox(availableValues);
77
			if( availableValues.length>0 ) {
78
				this.getJComboBox().setSelectedIndex(0);
79
			}
80
			this.contents.addFocusListener(this);
81
			if( this.getDefinition().isReadOnly() ) {
82
				this.getJComboBox().setEditable(false);
83
			}
84
		}
85
		this.setValue(this.assignedValue);
86
	}
87
	
88
	protected String getValueFromJComponent() {
89
		String s = null;
90
		if( this.contents instanceof JTextField ) {
91
			s = this.getJTextField().getText();
92
		} else {
93
			int selected =  this.getJComboBox().getSelectedIndex();
94
			if( selected <0 ) {
95
				s = null;
96
			} else {
97
				DynObjectValueItem value = (DynObjectValueItem) this.getJComboBox().getModel().getElementAt(selected);
98
				s = value.getValue().toString();
99
			}
100
		}
101
                if( StringUtils.isEmpty(s) && this.translateEmptyToNull() ) {
102
                    return null;
103
                }
104
		return s;
105
	}
106
	
107
	public void setValue(Object value) {
108
		String s = null;
109
		if( value == null ) {
110
		  this.setTranslateEmptyToNull(true);
111
			value = this.getDefinition().getDefaultValue();
112
			if( value == null ) {
113
				s = this.getDefaultValue();
114
			} else {
115
				s = value.toString();
116
			}
117
		} else {
118
		  this.setTranslateEmptyToNull(false);
119
			s = value.toString();
120
			try {
121
				this.getDefinition().validate(value);
122
				this.problemIndicator().clear();
123
			} catch (DynFieldValidateException e) {
124
				this.problemIndicator().set(e.getLocalizedMessage());
125
			}
126
		}
127
		if( this.contents instanceof JTextField ) {
128
			this.getJTextField().setText(s);
129
		} else {
130
			DynObjectValueItem item = null; 
131
			for(int i = 0; i< this.getJComboBox().getModel().getSize(); i++){
132
				item = (DynObjectValueItem) this.getJComboBox().getModel().getElementAt(i);
133
				if( item.getValue().equals(value)){
134
					break;
135
				}
136
			}
137
			if(item!=null) {
138
				this.getJComboBox().getModel().setSelectedItem(item);
139
			}
140
		}
141
		this.assignedValue = value;
142
	}
143
	
144
	/* 
145
	 * M?todos espec?ficos de cada tipo de datos
146
	 */
147
	protected String getDefaultValue(){
148
		return "";
149
	}
150
	
151
	public Object getValue() {
152
		Object value = null;
153
		String s = this.getValueFromJComponent();
154
                try {
155
                        value = this.getDefinition().coerce(s);
156
                } catch (CoercionException e) {
157
                        throw new IllegalFieldValue(this,"Can't convert value '"+s+"' to '"+ this.getDefinition().getDataType().getName() + "'.");
158
                }
159
		this.problemIndicator().clear();
160
		return value;
161
	}
162
	
163
	@SuppressWarnings("unused")
164
	public boolean hasValidValue() {
165
		try {
166
			Object value = this.getValue();
167
		} catch(Exception e) {
168
			return false;
169
		}
170
		return true;
171
	}
172

  
173
	public void focusGained(FocusEvent arg0) {
174
		fireFieldEnterEvent();
175
		this.problemIndicator().restore();
176
	}
177

  
178
	public void focusLost(FocusEvent arg0) {
179
		if( this.hasValidValue() ) {
180
			this.problemIndicator().clear();
181
		} else {
182
			try {
183
				Object value = this.getValue();
184
			} catch(Exception e) {
185
				this.problemIndicator().set(e.getLocalizedMessage());
186
			}
187
		}
188
		fireFieldExitEvent();
189
	}
190
	
191
	/**
192
	 * Este m?todo es por si se quiere a?adir una expresi?n regular al JTextField
193
	 * Por defecto, se puede escribir cualquier cosa, pero se puede sobreescribir este
194
	 * m?todo en la clase que lo requiera para a?adir restricciones (p.ej: en los num?ricos)
195
	 * @return expresi?n regular que filtra el contenido del JTextField
196
	 */
197
	public String getJTextFieldRegex(){
198
		return "[*]";
199
	}
200

  
201
	
202
	public class KeyAdapterRegEx extends KeyAdapter {
203

  
204
	    /**
205
	     * Key released on field.
206
	     */
207
	    public void keyReleased(KeyEvent e) {
208
	        String curText = ((JTextComponent) e.getSource()).getText();
209
	        curText = curText.replaceAll(getJTextFieldRegex(), "");
210

  
211
	        ((JTextComponent) e.getSource()).setText(curText);
212
	    }
213
	}
214
}
0 215

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/SupportPopupMenu.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import javax.swing.Action;
27

  
28

  
29
public interface SupportPopupMenu {
30
	public void addActionToPopupMenu(String name, Action action);
31
	public void addSeparatorToPopupMenu();
32
}
0 33

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/JProblemIndicator.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import org.gvsig.tools.swing.api.Component;
27

  
28
public interface JProblemIndicator extends Component {
29

  
30
	public void clear() ;
31
	public void set(String message) ;
32
	public void restore();
33

  
34
}
0 35

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/AbstractJDynFormFieldFactory.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import org.gvsig.tools.ToolsLocator;
27
import org.gvsig.tools.dynform.spi.DynFormSPIManager;
28
import org.gvsig.tools.dynform.spi.JDynFormFieldFactory;
29
import org.gvsig.tools.dynobject.DynField;
30
import org.gvsig.tools.dynobject.DynObject;
31
import org.gvsig.tools.dynobject.DynObjectManager;
32
import org.gvsig.tools.dynobject.DynStruct;
33
import org.gvsig.tools.service.Service;
34
import org.gvsig.tools.service.ServiceException;
35
import org.gvsig.tools.service.spi.ServiceManager;
36

  
37
public abstract class AbstractJDynFormFieldFactory implements JDynFormFieldFactory {
38

  
39
	protected String name = null;
40
	protected DynStruct parametersDefinition = null;
41
	
42
	public abstract String getName() ;
43

  
44
	public abstract Service create(DynObject parameters, ServiceManager serviceManager)
45
			throws ServiceException ;
46

  
47
	public DynObject createParameters() {
48
		return ToolsLocator.getDynObjectManager().createDynObject(parametersDefinition);
49
	}
50

  
51
	public void initialize() {
52
		if( this.parametersDefinition == null ) {
53
			String serviceName = this.getName();
54
    		DynObjectManager manager = ToolsLocator.getDynObjectManager();
55
    		this.parametersDefinition = manager.createDynClass(
56
    				serviceName, "Parameters definition for file fields in dynamic forms");
57
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_FIELDDEFINITION)
58
				.setClassOfValue(DynField.class).setMandatory(true);
59
    		this.parametersDefinition.addDynFieldObject(DynFormSPIManager.FIELD_VALUE)
60
				.setClassOfValue(DynField.class).setMandatory(true);
61
		}
62
	}
63

  
64
}
0 65

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/CustomSpinnerDateModel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import javax.swing.SpinnerDateModel;
27

  
28
public class CustomSpinnerDateModel extends SpinnerDateModel{
29

  
30
	/**
31
	 * 
32
	 */
33
	private static final long serialVersionUID = 4389535440347616567L;
34
	
35
}
0 36

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/JCustomTextField.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import java.awt.Color;
27

  
28
import javax.swing.Action;
29
import javax.swing.JPopupMenu;
30
import javax.swing.JTextField;
31
import javax.swing.UIManager;
32

  
33
import org.gvsig.tools.dynform.spi.DynFormSPILocator;
34

  
35
public class JCustomTextField extends JTextField  implements SupportPopupMenu{
36

  
37
	/**
38
	 * 
39
	 */
40
	private static final long serialVersionUID = 1575097883238348147L;
41
	private JPopupMenu popupMenu = null;
42
	private boolean hasEditor = true;
43
	private String title = null;
44
	
45
	private static Color backgroundColor = null; 
46
	
47
	public JCustomTextField(String title){
48
		super();
49
		if( backgroundColor == null ) {
50
			backgroundColor = UIManager.getLookAndFeel().getDefaults().getColor("TextField.background");
51
		}
52
		this.title = title;
53
		initContextMenu();
54
	}
55

  
56
	public JCustomTextField(String title, boolean withEditor){
57
		super();
58
		this.title = title;
59
		this.hasEditor   = withEditor;
60
		initContextMenu();
61
	}
62
	
63
	private void setActionEnabled(String name, boolean enabled) {
64
		Action action = this.getActionMap().get(name);
65
		if( action != null ) {
66
			action.setEnabled(enabled);
67
		}
68
	}
69
	
70
	public void setEnabled(boolean enabled){
71
		setActionEnabled("Cut", enabled);
72
		setActionEnabled("Paste", enabled);
73
		super.setEnabled(enabled);
74
	}
75

  
76
	
77
	public void setEditable(boolean enabled){
78
		setActionEnabled("Cut", enabled);
79
		setActionEnabled("Paste", enabled);
80
		super.setEditable(enabled);
81
		this.setBackground(backgroundColor);
82
	}
83
	
84
	private void initContextMenu() {
85
		this.add(getJPopupMenu());
86
		this.setComponentPopupMenu(getJPopupMenu());
87
	}
88
	
89
	public JPopupMenu getJPopupMenu(){
90
		if(this.popupMenu == null){
91
			this.popupMenu = DynFormSPILocator.getDynFormSPIManager().createTextFieldPopupMenu(title, this, hasEditor);
92
		}
93
		return this.popupMenu;
94
	}
95
	
96
	public void addActionToPopupMenu(String name, Action action){
97
		if(name != null && !name.isEmpty()){
98
			action.putValue(Action.NAME, name);
99
		}
100
		getJPopupMenu().add(action);
101
	}
102
	
103
	public void addSeparatorToPopupMenu(){
104
		getJPopupMenu().addSeparator();
105
	}
106

  
107
}
0 108

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/JZoomDialog.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.tools.dynform.spi.dynformfield;
25

  
26
import java.awt.Dialog;
27

  
28
import javax.swing.JDialog;
29

  
30
public abstract class JZoomDialog extends JDialog {
31
	
32
	/**
33
	 * 
34
	 */
35
	private static final long serialVersionUID = 8590635169959772532L;
36

  
37
	public JZoomDialog(String title) {
38
		super((Dialog)null, title, true);
39
	}
40

  
41
	public abstract String getText();
42
	
43
	public abstract void setEditable(boolean editable);
44
}
0 45

  
org.gvsig.tools/library/tags/org.gvsig.tools-3.0.31/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynformfield/VisitableSet.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff