@Override
	protected boolean isEnabledForContext(ListingActionContext context) {
		if (LabelMgrPlugin.getComponent(context) != null) {
			getPopupMenuData().setMenuItemName(EDIT_FIELDNAME);
			return true;
		}

		Symbol symbol = plugin.getSymbol(context);
		if (symbol == null) {
			return false;
		}

		if (symbol.isExternal()) {
			return false;
		}

		if (symbol.getSymbolType() == SymbolType.FUNCTION) {
			ProgramLocation location = context.getLocation();
			if (location instanceof OperandFieldLocation) {
				// Functions in operand fields are handled by the EditNameAction.  Return false
				// here to prevent 2 popup actions from appearing in the menu.
				return false;
			}
		}

		getPopupMenuData().setMenuItemName(EDIT_LABEL);
		return true;
	}
Creates a new instance of the action.

@param plugin Label Manager Plugin instance
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/label/EditLabelAction.java