if (port2All)
if (portOrTemplateMacro2All)
public Vector getLinkMenus(Enumeration vdbFields) {	Vector items = new Vector();	ActionListener l = createPopupmenuHandler();	VDBFieldData field;	JMenuItem menuitem;	boolean port2All = (getTargetLink() instanceof VDBPort);		if (getTargetLink()==null || port2All) {				JMenu inlinks = new JMenu(inlinkString);		JMenu outlinks = new JMenu(outlinkString);		JMenu fwdlinks = new JMenu(fwdlinkString);		JMenu varlinks = null;		if (port2All)			varlinks = new JMenu(varlinkString);		else			varlinks = new JMenu(varlinkPortString); 				JMenu inMenu = inlinks;			JMenu outMenu = outlinks;			JMenu fwdMenu = fwdlinks;			JMenu varMenu = varlinks;					int inpItems, outItems, fwdItems;		int varItems;		inpItems=outItems=fwdItems=0;		varItems=0; 		while (vdbFields.hasMoreElements()) {			field = (VDBFieldData)(vdbFields.nextElement());			if (field.getValue().equals(nullString)) {				switch (field.getType()) {					case DBDConstants.DBF_INLINK:						 menuitem = new JMenuItem(field.getName());						 menuitem.addActionListener(l);						 inlinks = PopUpMenu.addItem(menuitem, inlinks, inpItems); 						 inpItems++;						 break;					case DBDConstants.DBF_OUTLINK: 						 menuitem = new JMenuItem(field.getName());						 menuitem.addActionListener(l);						 outlinks = PopUpMenu.addItem(menuitem, outlinks, outItems); 						 outItems++;						 break;					case DBDConstants.DBF_FWDLINK:						 menuitem = new JMenuItem(field.getName());						 menuitem.addActionListener(l);						 fwdlinks = PopUpMenu.addItem(menuitem, fwdlinks, fwdItems); 						 fwdItems++;						 break;					default:						 // no not add fields with undefined GUI type						 if (!port2All && field.getGUI_type() == DBDConstants.GUI_UNDEFINED)						 	break;						 menuitem = new JMenuItem(field.getName());						 menuitem.addActionListener(l);						 varlinks = PopUpMenu.addItem(menuitem, varlinks, varItems); 						 varItems++;						 break;									}			}		}		if (inMenu.getItemCount() > 0)			items.addElement(inMenu);		if (outMenu.getItemCount() > 0)			items.addElement(outMenu);		if (fwdMenu.getItemCount() > 0)			items.addElement(fwdMenu);		if (varMenu.getItemCount() > 0)			items.addElement(varMenu);	}	else if ((getTargetLink().getType() == DBDConstants.DBF_INLINK) ||		  	  (getTargetLink().getType() == DBDConstants.DBF_OUTLINK) ||			  (getTargetLink().getType() == DBDConstants.DBF_FWDLINK)) { // no targets (only ports) for VAR->PORTS		int count = 0;		JMenu varlinkItem = new JMenu(varlinkString);		JMenu menu = varlinkItem;				while (vdbFields.hasMoreElements()) {			field = (VDBFieldData)(vdbFields.nextElement());/*			switch (field.getType()) {				case DBDConstants.DBF_CHAR: 				case DBDConstants.DBF_UCHAR: 				case DBDConstants.DBF_SHORT: 				case DBDConstants.DBF_USHORT: 				case DBDConstants.DBF_LONG: 				case DBDConstants.DBF_ULONG: 				case DBDConstants.DBF_FLOAT: 				case DBDConstants.DBF_DOUBLE: 				case DBDConstants.DBF_STRING:				case DBDConstants.DBF_NOACCESS:					case DBDConstants.DBF_ENUM:				case DBDConstants.DBF_MENU:				case DBDConstants.DBF_DEVICE:  // ?				  menuitem = new JMenuItem(field.getName());				  menuitem.addActionListener(l);				  menu = PopUpMenu.addItem(menuitem, menu, count);				  count++; 			}*/			if (field.getType()!=DBDConstants.DBF_INLINK &&				field.getType()!=DBDConstants.DBF_OUTLINK &&				field.getType()!=DBDConstants.DBF_FWDLINK)			{				  menuitem = new JMenuItem(field.getName());				  menuitem.addActionListener(l);				  menu = PopUpMenu.addItem(menuitem, menu, count);				  count++; 			}		}		if (count > 0) items.addElement(varlinkItem);			}			return items;}