Revision 2285 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.dynform/org.gvsig.tools.dynform.spi/src/main/java/org/gvsig/tools/dynform/spi/dynform/AbstractJDynForm.java
AbstractJDynForm.java | ||
---|---|---|
28 | 28 |
import org.gvsig.tools.dataTypes.DataType; |
29 | 29 |
import org.gvsig.tools.dataTypes.DataTypes; |
30 | 30 |
import org.gvsig.tools.dynform.DynFormDefinition; |
31 |
import org.gvsig.tools.dynform.DynFormFieldDefinition; |
|
31 | 32 |
import org.gvsig.tools.dynform.JDynForm; |
32 | 33 |
import org.gvsig.tools.dynform.JDynFormField; |
33 | 34 |
import org.gvsig.tools.dynform.spi.DynFormSPIManager; |
... | ... | |
392 | 393 |
this.asJComponent().setPreferredSize(new Dimension(width, height)); |
393 | 394 |
} |
394 | 395 |
} |
395 |
|
|
396 |
public void configurePopupMenu(JDynFormField jfield) { |
|
397 |
DynFormFieldDefinition fieldDefinition = jfield.getDefinition(); |
|
398 |
List<Action> customActions = getCustomActionsForDataType(fieldDefinition.getDataType()); |
|
399 |
if (customActions != null && !customActions.isEmpty()) { |
|
400 |
for (Action customAction : customActions) { |
|
401 |
if (customAction != null) { |
|
402 |
jfield.addActionToPopupMenu((String) customAction.getValue(Action.NAME), customAction); |
|
403 |
} else { |
|
404 |
jfield.addSeparatorToPopupMenu(); |
|
405 |
} |
|
406 |
} |
|
407 |
} |
|
408 |
this.getServiceManager().configurePopupMenu(jfield); |
|
409 |
} |
|
410 |
|
|
396 | 411 |
protected List<Action> getCustomActionsForDataType(DataType dataType) { |
397 | 412 |
return (List<Action>) customActions.get(dataType.getName()); |
398 | 413 |
} |
Also available in: Unified diff