public DcFileRenamerPopupMenu(DcFilePatternField fpf, int modIdx) {
JMenuItem menuInsertText = ComponentFactory.getMenuItem(DcResources.getText("lblInsertText"));
JMenuItem menuInsertDir = ComponentFactory.getMenuItem(DcResources.getText("lblInsertDirectory"));
JMenuItem menuRemove = ComponentFactory.getMenuItem(DcResources.getText("lblRemove"));
JMenu menuInsertField = ComponentFactory.getMenu(DcResources.getText("lblInsertField"));
DcModule module = DcModules.get(modIdx);
for (DcField field : DcModules.get(modIdx).getFields()) {
if (field.getIndex() == DcObject._SYS_CONTAINER)
continue;
if (field.getIndex() == module.getParentReferenceFieldIndex()) {
JMenuItem menuField = ComponentFactory.getMenuItem( module.getParent().getObjectName());
menuField.setActionCommand(String.valueOf(field.getIndex()));
menuField.addActionListener(fpf);
menuInsertField.add(menuField);
} else if (isValid(field)) {
JMenuItem menuField = ComponentFactory.getMenuItem(field.getSystemName());
menuField.setActionCommand(String.valueOf(field.getIndex()));
menuField.addActionListener(fpf);
menuInsertField.add(menuField);
}
}
menuInsertText.setActionCommand("insertText");
menuInsertDir.setActionCommand("insertDirectory");